gi-adwaita-1.0.3: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Adw.Objects.ViewStack

Description

A view container for [classviewSwitcher].

AdwViewStack is a container which only shows one page at a time. It is typically used to hold an application's main views.

It doesn't provide a way to transition between pages. Instead, a separate widget such as [classviewSwitcher] can be used with AdwViewStack to provide this functionality.

AdwViewStack pages can have a title, an icon, an attention request, and a numbered badge that [classviewSwitcher] will use to let users identify which page is which. Set them using the [propertyviewStackPage:title], [propertyviewStackPage:icon-name], [propertyviewStackPage:needs-attention], and [propertyviewStackPage:badge-number] properties.

Unlike Stack, transitions between views are not animated.

AdwViewStack maintains a [classviewStackPage] object for each added child, which holds additional per-child properties. You obtain the [classviewStackPage] for a child with [methodviewStack.get_page] and you can obtain a SelectionModel containing all the pages with [methodviewStack.get_pages].

AdwViewStack as GtkBuildable

To set child-specific properties in a .ui file, create [classviewStackPage] objects explicitly, and set the child widget as a property on it:

xml code

 <object class="AdwViewStack" id="stack">
   <child>
     <object class="AdwViewStackPage">
       <property name="name">overview</property>
       <property name="title">Overview</property>
       <property name="child">
         <object class="AdwStatusPage">
           <property name="title">Welcome!</property>
         </object>
       </property>
     </object>
   </child>
 </object>

CSS nodes

AdwViewStack has a single CSS node named stack.

Since: 1.0

Synopsis

Exported types

newtype ViewStack Source #

Memory-managed wrapper type.

Constructors

ViewStack (ManagedPtr ViewStack) 

Instances

Instances details
Eq ViewStack Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

GObject ViewStack Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

ManagedPtrNewtype ViewStack Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

Methods

toManagedPtr :: ViewStack -> ManagedPtr ViewStack

TypedObject ViewStack Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

Methods

glibType :: IO GType

HasParentTypes ViewStack Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

IsGValue (Maybe ViewStack) Source #

Convert ViewStack to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Adw.Objects.ViewStack

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ViewStack -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ViewStack)

type ParentTypes ViewStack Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

type ParentTypes ViewStack = '[Widget, Object, Accessible, Buildable, ConstraintTarget]

class (GObject o, IsDescendantOf ViewStack o) => IsViewStack o Source #

Type class for types which can be safely cast to ViewStack, for instance with toViewStack.

Instances

Instances details
(GObject o, IsDescendantOf ViewStack o) => IsViewStack o Source # 
Instance details

Defined in GI.Adw.Objects.ViewStack

toViewStack :: (MonadIO m, IsViewStack o) => o -> m ViewStack Source #

Cast to ViewStack, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, add, addController, addCssClass, addMnemonicLabel, addNamed, addTickCallback, addTitled, addTitledWithIcon, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChildByName, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getHhomogeneous, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPage, getPages, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVhomogeneous, getVisible, getVisibleChild, getVisibleChildName, getWidth.

Setters

setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setHhomogeneous, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVhomogeneous, setVisible, setVisibleChild, setVisibleChildName.

add

viewStackAdd Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a view stack

-> b

child: the widget to add

-> m ViewStackPage

Returns: the [classviewStackPage] for child

Adds a child to self.

Since: 1.0

addNamed

viewStackAddNamed Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a view stack

-> b

child: the widget to add

-> Maybe Text

name: the name for child

-> m ViewStackPage

Returns: the AdwViewStackPage for child

Adds a child to self.

The child is identified by the name.

Since: 1.0

addTitled

viewStackAddTitled Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a view stack

-> b

child: the widget to add

-> Maybe Text

name: the name for child

-> Text

title: a human-readable title for child

-> m ViewStackPage

Returns: the AdwViewStackPage for child

Adds a child to self.

The child is identified by the name. The title will be used by [classviewSwitcher] to represent child, so it should be short.

Since: 1.0

addTitledWithIcon

viewStackAddTitledWithIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a view stack

-> b

child: the widget to add

-> Maybe Text

name: the name for child

-> Text

title: a human-readable title for child

-> Text

iconName: an icon name for child

-> m ViewStackPage

Returns: the AdwViewStackPage for child

Adds a child to self.

The child is identified by the name. The title and iconName will be used by [classviewSwitcher] to represent child.

Since: 1.2

getChildByName

viewStackGetChildByName Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> Text

name: the name of the child to find

-> m (Maybe Widget)

Returns: the requested child

Finds the child with name in self.

Since: 1.0

getHhomogeneous

viewStackGetHhomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> m Bool

Returns: whether self is horizontally homogeneous

Gets whether self is horizontally homogeneous.

Since: 1.0

getPage

viewStackGetPage Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a view stack

-> b

child: a child of self

-> m ViewStackPage

Returns: the page object for child

Gets the [classviewStackPage] object for child.

Since: 1.0

getPages

viewStackGetPages Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> m SelectionModel

Returns: a GtkSelectionModel for the stack's children

Returns a ListModel that contains the pages of the stack.

This can be used to keep an up-to-date view. The model also implements SelectionModel and can be used to track and change the visible page.

Since: 1.0

getVhomogeneous

viewStackGetVhomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> m Bool

Returns: whether self is vertically homogeneous

Gets whether self is vertically homogeneous.

Since: 1.0

getVisibleChild

viewStackGetVisibleChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> m (Maybe Widget)

Returns: the visible child

Gets the currently visible child of self, .

Since: 1.0

getVisibleChildName

viewStackGetVisibleChildName Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> m (Maybe Text)

Returns: the name of the visible child

Returns the name of the currently visible child of self.

Since: 1.0

new

viewStackNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ViewStack

Returns: the newly created AdwViewStack

Creates a new AdwViewStack.

Since: 1.0

remove

viewStackRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a view stack

-> b

child: the child to remove

-> m () 

Removes a child widget from self.

Since: 1.0

setHhomogeneous

viewStackSetHhomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> Bool

hhomogeneous: whether to make self horizontally homogeneous

-> m () 

Sets self to be horizontally homogeneous or not.

If the stack is horizontally homogeneous, it allocates the same width for all children.

If it's FALSE, the stack may change width when a different child becomes visible.

Since: 1.0

setVhomogeneous

viewStackSetVhomogeneous Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> Bool

vhomogeneous: whether to make self vertically homogeneous

-> m () 

Sets self to be vertically homogeneous or not.

If the stack is vertically homogeneous, it allocates the same height for all children.

If it's FALSE, the stack may change height when a different child becomes visible.

Since: 1.0

setVisibleChild

viewStackSetVisibleChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a, IsWidget b) 
=> a

self: a view stack

-> b

child: a child of self

-> m () 

Makes child the visible child of self.

Since: 1.0

setVisibleChildName

viewStackSetVisibleChildName Source #

Arguments

:: (HasCallStack, MonadIO m, IsViewStack a) 
=> a

self: a view stack

-> Text

name: the name of the child

-> m () 

Makes the child with name visible.

See [propertyviewStack:visible-child].

Since: 1.0

Properties

hhomogeneous

Whether the stack is horizontally homogeneous.

If the stack is horizontally homogeneous, it allocates the same width for all children.

If it's FALSE, the stack may change width when a different child becomes visible.

Since: 1.0

constructViewStackHhomogeneous :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “hhomogeneous” property. This is rarely needed directly, but it is used by new.

getViewStackHhomogeneous :: (MonadIO m, IsViewStack o) => o -> m Bool Source #

Get the value of the “hhomogeneous” property. When overloading is enabled, this is equivalent to

get viewStack #hhomogeneous

setViewStackHhomogeneous :: (MonadIO m, IsViewStack o) => o -> Bool -> m () Source #

Set the value of the “hhomogeneous” property. When overloading is enabled, this is equivalent to

set viewStack [ #hhomogeneous := value ]

pages

A selection model with the stack's pages.

This can be used to keep an up-to-date view. The model also implements SelectionModel and can be used to track and change the visible page.

getViewStackPages :: (MonadIO m, IsViewStack o) => o -> m (Maybe SelectionModel) Source #

Get the value of the “pages” property. When overloading is enabled, this is equivalent to

get viewStack #pages

vhomogeneous

Whether the stack is vertically homogeneous.

If the stack is vertically homogeneous, it allocates the same height for all children.

If it's FALSE, the stack may change height when a different child becomes visible.

Since: 1.0

constructViewStackVhomogeneous :: (IsViewStack o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “vhomogeneous” property. This is rarely needed directly, but it is used by new.

getViewStackVhomogeneous :: (MonadIO m, IsViewStack o) => o -> m Bool Source #

Get the value of the “vhomogeneous” property. When overloading is enabled, this is equivalent to

get viewStack #vhomogeneous

setViewStackVhomogeneous :: (MonadIO m, IsViewStack o) => o -> Bool -> m () Source #

Set the value of the “vhomogeneous” property. When overloading is enabled, this is equivalent to

set viewStack [ #vhomogeneous := value ]

visibleChild

The widget currently visible in the stack.

Since: 1.0

constructViewStackVisibleChild :: (IsViewStack o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “visible-child” property. This is rarely needed directly, but it is used by new.

getViewStackVisibleChild :: (MonadIO m, IsViewStack o) => o -> m (Maybe Widget) Source #

Get the value of the “visible-child” property. When overloading is enabled, this is equivalent to

get viewStack #visibleChild

setViewStackVisibleChild :: (MonadIO m, IsViewStack o, IsWidget a) => o -> a -> m () Source #

Set the value of the “visible-child” property. When overloading is enabled, this is equivalent to

set viewStack [ #visibleChild := value ]

visibleChildName

The name of the widget currently visible in the stack.

See [propertyviewStack:visible-child].

Since: 1.0

constructViewStackVisibleChildName :: (IsViewStack o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “visible-child-name” property. This is rarely needed directly, but it is used by new.

getViewStackVisibleChildName :: (MonadIO m, IsViewStack o) => o -> m (Maybe Text) Source #

Get the value of the “visible-child-name” property. When overloading is enabled, this is equivalent to

get viewStack #visibleChildName

setViewStackVisibleChildName :: (MonadIO m, IsViewStack o) => o -> Text -> m () Source #

Set the value of the “visible-child-name” property. When overloading is enabled, this is equivalent to

set viewStack [ #visibleChildName := value ]