Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | None |
A frame that constrains its child to a particular aspect ratio
- data AspectFrame
- class FrameClass o => AspectFrameClass o
- castToAspectFrame :: GObjectClass obj => obj -> AspectFrame
- gTypeAspectFrame :: GType
- toAspectFrame :: AspectFrameClass o => o -> AspectFrame
- aspectFrameNew :: Float -> Float -> Maybe Float -> IO AspectFrame
- aspectFrameSet :: AspectFrameClass self => self -> Float -> Float -> Maybe Float -> IO ()
- aspectFrameXAlign :: AspectFrameClass self => Attr self Float
- aspectFrameYAlign :: AspectFrameClass self => Attr self Float
- aspectFrameRatio :: AspectFrameClass self => Attr self Float
- aspectFrameObeyChild :: AspectFrameClass self => Attr self Bool
Detail
The AspectFrame
is useful when you want pack a widget so that it can
resize but always retains the same aspect ratio. For instance, one might be
drawing a small preview of a larger image. AspectFrame
derives from
Frame
, so it can draw a label and a frame around the child. The frame will
be "shrink-wrapped" to the size of the child.
Class Hierarchy
Types
data AspectFrame Source
class FrameClass o => AspectFrameClass o Source
castToAspectFrame :: GObjectClass obj => obj -> AspectFrameSource
toAspectFrame :: AspectFrameClass o => o -> AspectFrameSource
Constructors
:: Float |
|
-> Float |
|
-> Maybe Float |
|
-> IO AspectFrame |
Create a new AspectFrame
.
The frame may be augmented with a label which can be set by frameSetLabel
.
Methods
:: AspectFrameClass self | |
=> self | |
-> Float |
|
-> Float |
|
-> Maybe Float |
|
-> IO () |
Set parameters for an existing AspectFrame
.
Attributes
aspectFrameXAlign :: AspectFrameClass self => Attr self FloatSource
X alignment of the child.
Allowed values: [0,1]
Default value: 0.5
aspectFrameYAlign :: AspectFrameClass self => Attr self FloatSource
Y alignment of the child.
Allowed values: [0,1]
Default value: 0.5
aspectFrameRatio :: AspectFrameClass self => Attr self FloatSource
Aspect ratio if obey_child is False
.
Allowed values: [1e-04,10000]
Default value: 0.5
aspectFrameObeyChild :: AspectFrameClass self => Attr self BoolSource
Force aspect ratio to match that of the frame's child.
Default value: True