gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Layout.AspectFrame

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes

Description

A frame that constrains its child to a particular aspect ratio

Synopsis

- 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

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----Bin
    | +----Frame
    | +----AspectFrame

# Types

data AspectFrame Source #

#### Instances

Instances details

Eq AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: AspectFrame -> AspectFrame -> Bool Source # (/=) :: AspectFrame -> AspectFrame -> Bool Source #
Ord AspectFrame Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: AspectFrame -> AspectFrame -> Ordering Source #

(<) :: AspectFrame -> AspectFrame -> Bool Source #

(<=) :: AspectFrame -> AspectFrame -> Bool Source #

(>) :: AspectFrame -> AspectFrame -> Bool Source #

(>=) :: AspectFrame -> AspectFrame -> Bool Source #

max :: AspectFrame -> AspectFrame -> AspectFrame Source #

min :: AspectFrame -> AspectFrame -> AspectFrame Source #

GObjectClass AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: AspectFrame -> GObject Source # unsafeCastGObject :: GObject -> AspectFrame Source #
AspectFrameClass AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types
BinClass AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ContainerClass AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types
FrameClass AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class FrameClass o => AspectFrameClass o Source #

#### Instances

Instances details

AspectFrameClass AspectFrame Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToAspectFrame :: GObjectClass obj => obj -> AspectFrame Source #

gTypeAspectFrame :: GType Source #

toAspectFrame :: AspectFrameClass o => o -> AspectFrame Source #

# Constructors

aspectFrameNew Source #

Arguments

:: Float | `xalign` - Horizontal alignment of the child within the allocation of the `AspectFrame`. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
-> Float | `yalign` - Vertical alignment of the child within the allocation of the `AspectFrame`. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
-> Maybe Float | `ratio` - The desired aspect ratio. If `Nothing` the aspect ratio is taken from the requistion of the child.
-> IO AspectFrame |

Create a new `AspectFrame`.

The frame may be augmented with a label which can be set by `frameSetLabel`.

# Methods

aspectFrameSet Source #

Arguments

:: AspectFrameClass self |
=> self |
-> Float | `xalign` - Horizontal alignment of the child within the allocation of the `AspectFrame`. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
-> Float | `yalign` - Vertical alignment of the child within the allocation of the `AspectFrame`. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
-> Maybe Float | `ratio` - The desired aspect ratio. If `Nothing` the aspect ratio is taken from the requistion of the child.
-> IO () |

Set parameters for an existing `AspectFrame`.

# Attributes

aspectFrameXAlign :: AspectFrameClass self => Attr self Float Source #

X alignment of the child.

Allowed values: [0,1]

Default value: 0.5

aspectFrameYAlign :: AspectFrameClass self => Attr self Float Source #

Y alignment of the child.

Allowed values: [0,1]

Default value: 0.5

aspectFrameRatio :: AspectFrameClass self => Attr self Float Source #

Aspect ratio if obey_child is `False`.

Allowed values: [1e-04,10000]

Default value: 0.5

aspectFrameObeyChild :: AspectFrameClass self => Attr self Bool Source #

Force aspect ratio to match that of the frame's child.

Default value: `True`