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 |
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
- noAspectFrame :: Maybe AspectFrame
- aspectFrameNew :: (HasCallStack, MonadIO m) => Maybe Text -> Float -> Float -> Float -> Bool -> m AspectFrame
- aspectFrameSet :: (HasCallStack, MonadIO m, IsAspectFrame a) => a -> Float -> Float -> Float -> Bool -> m ()
- constructAspectFrameObeyChild :: IsAspectFrame o => Bool -> IO (GValueConstruct o)
- getAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> m Bool
- setAspectFrameObeyChild :: (MonadIO m, IsAspectFrame o) => o -> Bool -> m ()
- constructAspectFrameRatio :: IsAspectFrame o => Float -> IO (GValueConstruct o)
- getAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameRatio :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()
- constructAspectFrameXalign :: IsAspectFrame o => Float -> IO (GValueConstruct o)
- getAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> m Float
- setAspectFrameXalign :: (MonadIO m, IsAspectFrame o) => o -> Float -> m ()
- constructAspectFrameYalign :: IsAspectFrame o => Float -> IO (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.
Instances
Eq AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame (==) :: AspectFrame -> AspectFrame -> Bool # (/=) :: AspectFrame -> AspectFrame -> Bool # | |
IsGValue AspectFrame Source # | Convert |
Defined in GI.Gtk.Objects.AspectFrame toGValue :: AspectFrame -> IO GValue # fromGValue :: GValue -> IO AspectFrame # | |
GObject AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame gobjectType :: IO GType # | |
HasParentTypes AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame | |
type ParentTypes AspectFrame Source # | |
Defined in GI.Gtk.Objects.AspectFrame type ParentTypes AspectFrame = '[Frame, Bin, Container, Widget, Object, ImplementorIface, Buildable] |
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
.
noAspectFrame :: Maybe AspectFrame Source #
A convenience alias for Nothing
:: Maybe
AspectFrame
.
Methods
Overloaded methods
new
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Bool |
|
-> m AspectFrame | Returns: the new |
Create a new AspectFrame
.
set
:: (HasCallStack, MonadIO m, IsAspectFrame a) | |
=> a |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Bool |
|
-> m () |
Set parameters for an existing AspectFrame
.
Properties
obeyChild
No description available in the introspection data.
constructAspectFrameObeyChild :: IsAspectFrame o => Bool -> IO (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
set
aspectFrame [ #obeyChild:=
value ]
ratio
No description available in the introspection data.
constructAspectFrameRatio :: IsAspectFrame o => Float -> IO (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
set
aspectFrame [ #ratio:=
value ]
xalign
No description available in the introspection data.
constructAspectFrameXalign :: IsAspectFrame o => Float -> IO (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
set
aspectFrame [ #xalign:=
value ]
yalign
No description available in the introspection data.
constructAspectFrameYalign :: IsAspectFrame o => Float -> IO (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
set
aspectFrame [ #yalign:=
value ]