| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gtk.Objects.AspectFrame
Description
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.
CSS nodes
GtkAspectFrame uses a CSS node with name frame.
Synopsis
- newtype AspectFrame = AspectFrame (ManagedPtr AspectFrame)
- class (GObject o, IsDescendantOf AspectFrame o) => IsAspectFrame o
- toAspectFrame :: (MonadIO m, IsAspectFrame o) => o -> m AspectFrame
- aspectFrameGetChild :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m (Maybe Widget)
- aspectFrameGetObeyChild :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Bool
- aspectFrameGetRatio :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Float
- aspectFrameGetXalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Float
- aspectFrameGetYalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> m Float
- aspectFrameNew :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Bool -> m AspectFrame
- aspectFrameSetChild :: (HasCallStack, MonadIO m, IsAspectFrame a, IsWidget b) => a -> Maybe b -> m ()
- aspectFrameSetObeyChild :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Bool -> m ()
- aspectFrameSetRatio :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Float -> m ()
- aspectFrameSetXalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Float -> m ()
- aspectFrameSetYalign :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Float -> m ()
- clearAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m ()
- constructAspectFrameChild :: (IsAspectFrame o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m (Maybe Widget)
- setAspectFrameChild :: (MonadIO m, IsAspectFrame o, IsWidget a) => o -> a -> m ()
- constructAspectFrameObeyChild :: (IsAspectFrame o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> m Bool
- setAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> Bool -> m ()
- constructAspectFrameRatio :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()
- constructAspectFrameXalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()
- constructAspectFrameYalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o)
- getAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()
Exported types
newtype AspectFrame Source #
Memory-managed wrapper type.
Constructors
| AspectFrame (ManagedPtr AspectFrame) |
Instances
| Eq AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame | |
| GObject AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame | |
| ManagedPtrNewtype AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame Methods toManagedPtr :: AspectFrame -> ManagedPtr AspectFrame | |
| TypedObject AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame Methods glibType :: IO GType | |
| IsGValue AspectFrame Source # | Convert |
Defined in GI.Gtk.Objects.AspectFrame | |
| HasParentTypes AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame | |
| type ParentTypes AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame | |
class (GObject o, IsDescendantOf AspectFrame o) => IsAspectFrame o Source #
Type class for types which can be safely cast to AspectFrame, for instance with toAspectFrame.
Instances
| (GObject o, IsDescendantOf AspectFrame o) => IsAspectFrame o Source # | |
Defined in GI.Gtk.Objects.AspectFrame | |
toAspectFrame :: (MonadIO m, IsAspectFrame o) => o -> m AspectFrame Source #
Cast to AspectFrame, for types for which this is known to be safe. For general casts, use castTo.
Methods
Overloaded methods
getChild
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> m (Maybe Widget) | Returns: the child widget of self@ |
Gets the child widget of self.
getObeyChild
aspectFrameGetObeyChild Source #
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> m Bool | Returns: whether to obey the childs size request |
Returns whether the childs size request should override
the set aspect ratio of the AspectFrame.
getRatio
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> m Float | Returns: the desired aspect ratio |
Returns the desired aspect ratio of the child.
getXalign
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> m Float | Returns: the horizontal alignment |
Returns the horizontal alignment of the child within the
allocation of the AspectFrame.
getYalign
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> m Float | Returns: the vertical alignment |
Returns the vertical alignment of the child within the
allocation of the AspectFrame.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Float |
|
| -> Float |
|
| -> Float |
|
| -> Bool |
|
| -> m AspectFrame | Returns: the new |
Create a new AspectFrame.
setChild
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a, IsWidget b) | |
| => a |
|
| -> Maybe b |
|
| -> m () |
Sets the child widget of self.
setObeyChild
aspectFrameSetObeyChild Source #
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> Bool |
|
| -> m () |
Sets whether the aspect ratio of the childs size
request should override the set aspect ratio of
the AspectFrame.
setRatio
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> Float |
|
| -> m () |
Sets the desired aspect ratio of the child.
setXalign
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> Float |
|
| -> m () |
Sets the horizontal alignment of the child within the allocation
of the AspectFrame.
setYalign
Arguments
| :: (HasCallStack, MonadIO m, IsAspectFrame a) | |
| => a |
|
| -> Float |
|
| -> m () |
Sets the vertical alignment of the child within the allocation
of the AspectFrame.
Properties
child
No description available in the introspection data.
clearAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m () Source #
Set the value of the “child” property to Nothing.
When overloading is enabled, this is equivalent to
clear #child
constructAspectFrameChild :: (IsAspectFrame o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “child” property. This is rarely needed directly, but it is used by new.
getAspectFrameChild :: (MonadIO m, IsAspectFrame o) => o -> m (Maybe Widget) Source #
Get the value of the “child” property.
When overloading is enabled, this is equivalent to
get aspectFrame #child
setAspectFrameChild :: (MonadIO m, IsAspectFrame o, IsWidget a) => o -> a -> m () Source #
Set the value of the “child” property.
When overloading is enabled, this is equivalent to
setaspectFrame [ #child:=value ]
obeyChild
No description available in the introspection data.
constructAspectFrameObeyChild :: (IsAspectFrame o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “obey-child” property. This is rarely needed directly, but it is used by new.
getAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> m Bool Source #
Get the value of the “obey-child” property.
When overloading is enabled, this is equivalent to
get aspectFrame #obeyChild
setAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> Bool -> m () Source #
Set the value of the “obey-child” property.
When overloading is enabled, this is equivalent to
setaspectFrame [ #obeyChild:=value ]
ratio
No description available in the introspection data.
constructAspectFrameRatio :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “ratio” property. This is rarely needed directly, but it is used by new.
getAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> m Float Source #
Get the value of the “ratio” property.
When overloading is enabled, this is equivalent to
get aspectFrame #ratio
setAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> Float -> m () Source #
Set the value of the “ratio” property.
When overloading is enabled, this is equivalent to
setaspectFrame [ #ratio:=value ]
xalign
No description available in the introspection data.
constructAspectFrameXalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “xalign” property. This is rarely needed directly, but it is used by new.
getAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> m Float Source #
Get the value of the “xalign” property.
When overloading is enabled, this is equivalent to
get aspectFrame #xalign
setAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m () Source #
Set the value of the “xalign” property.
When overloading is enabled, this is equivalent to
setaspectFrame [ #xalign:=value ]
yalign
No description available in the introspection data.
constructAspectFrameYalign :: (IsAspectFrame o, MonadIO m) => Float -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “yalign” property. This is rarely needed directly, but it is used by new.
getAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> m Float Source #
Get the value of the “yalign” property.
When overloading is enabled, this is equivalent to
get aspectFrame #yalign
setAspectFrameYalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m () Source #
Set the value of the “yalign” property.
When overloading is enabled, this is equivalent to
setaspectFrame [ #yalign:=value ]