Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A Statusbar
is usually placed along the bottom of an application's
main Window
. It may provide a regular commentary of the application's
status (as is usually the case in a web browser, for example), or may be
used to simply output a message when the status changes, (when an upload
is complete in an FTP client, for example).
Status bars in GTK+ maintain a stack of messages. The message at the top of the each bar’s stack is the one that will currently be displayed.
Any messages added to a statusbar’s stack must specify a
context id that is used to uniquely identify
the source of a message. This context id can be generated by
statusbarGetContextId
, given a message and the statusbar that
it will be added to. Note that messages are stored in a stack, and when
choosing which message to display, the stack structure is adhered to,
regardless of the context identifier of a message.
One could say that a statusbar maintains one stack of messages for display purposes, but allows multiple message producers to maintain sub-stacks of the messages they produced (via context ids).
Status bars are created using statusbarNew
.
Messages are added to the bar’s stack with statusbarPush
.
The message at the top of the stack can be removed using
statusbarPop
. A message can be removed from anywhere in the
stack if its message id was recorded at the time it was added. This
is done using statusbarRemove
.
CSS node
GtkStatusbar has a single CSS node with name statusbar.
Synopsis
- newtype Statusbar = Statusbar (ManagedPtr Statusbar)
- class (GObject o, IsDescendantOf Statusbar o) => IsStatusbar o
- toStatusbar :: (MonadIO m, IsStatusbar o) => o -> m Statusbar
- statusbarGetContextId :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Text -> m Word32
- statusbarGetMessageArea :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> m Box
- statusbarNew :: (HasCallStack, MonadIO m) => m Statusbar
- statusbarPop :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> m ()
- statusbarPush :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> Text -> m Word32
- statusbarRemove :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> Word32 -> m ()
- statusbarRemoveAll :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> m ()
- type StatusbarTextPoppedCallback = Word32 -> Text -> IO ()
- afterStatusbarTextPopped :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPoppedCallback) -> m SignalHandlerId
- onStatusbarTextPopped :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPoppedCallback) -> m SignalHandlerId
- type StatusbarTextPushedCallback = Word32 -> Text -> IO ()
- afterStatusbarTextPushed :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPushedCallback) -> m SignalHandlerId
- onStatusbarTextPushed :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPushedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Statusbar Source # | |
GObject Statusbar Source # | |
Defined in GI.Gtk.Objects.Statusbar | |
ManagedPtrNewtype Statusbar Source # | |
Defined in GI.Gtk.Objects.Statusbar toManagedPtr :: Statusbar -> ManagedPtr Statusbar | |
TypedObject Statusbar Source # | |
Defined in GI.Gtk.Objects.Statusbar | |
HasParentTypes Statusbar Source # | |
Defined in GI.Gtk.Objects.Statusbar | |
IsGValue (Maybe Statusbar) Source # | Convert |
Defined in GI.Gtk.Objects.Statusbar gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Statusbar -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Statusbar) | |
type ParentTypes Statusbar Source # | |
Defined in GI.Gtk.Objects.Statusbar |
class (GObject o, IsDescendantOf Statusbar o) => IsStatusbar o Source #
Type class for types which can be safely cast to Statusbar
, for instance with toStatusbar
.
Instances
(GObject o, IsDescendantOf Statusbar o) => IsStatusbar o Source # | |
Defined in GI.Gtk.Objects.Statusbar |
toStatusbar :: (MonadIO m, IsStatusbar o) => o -> m Statusbar Source #
Methods
Click to display all available methods, including inherited ones
Methods
activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, packEnd, packStart, parserFinished, path, pop, propagateDraw, push, queryChildPacking, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeAll, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reorderChild, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBaselinePosition, getBorderWidth, getCanDefault, getCanFocus, getCenterWidget, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getContextId, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getHomogeneous, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getMessageArea, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getOrientation, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getSpacing, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.
Setters
setAccelPath, setAllocation, setAppPaintable, setBaselinePosition, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setCenterWidget, setChildPacking, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setHomogeneous, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setSpacing, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
getContextId
statusbarGetContextId Source #
:: (HasCallStack, MonadIO m, IsStatusbar a) | |
=> a |
|
-> Text |
|
-> m Word32 | Returns: an integer id |
Returns a new context identifier, given a description of the actual context. Note that the description is not shown in the UI.
getMessageArea
statusbarGetMessageArea Source #
:: (HasCallStack, MonadIO m, IsStatusbar a) | |
=> a |
|
-> m Box | Returns: a |
Retrieves the box containing the label widget.
Since: 2.20
new
:: (HasCallStack, MonadIO m) | |
=> m Statusbar | Returns: the new |
Creates a new Statusbar
ready for messages.
pop
:: (HasCallStack, MonadIO m, IsStatusbar a) | |
=> a |
|
-> Word32 |
|
-> m () |
Removes the first message in the Statusbar
’s stack
with the given context id.
Note that this may not change the displayed message, if the message at the top of the stack has a different context id.
push
:: (HasCallStack, MonadIO m, IsStatusbar a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> m Word32 | Returns: a message id that can be used with
|
Pushes a new message onto a statusbar’s stack.
remove
:: (HasCallStack, MonadIO m, IsStatusbar a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Forces the removal of a message from a statusbar’s stack.
The exact contextId
and messageId
must be specified.
removeAll
:: (HasCallStack, MonadIO m, IsStatusbar a) | |
=> a |
|
-> Word32 |
|
-> m () |
Forces the removal of all messages from a statusbar's
stack with the exact contextId
.
Since: 2.22
Signals
textPopped
type StatusbarTextPoppedCallback Source #
= Word32 |
|
-> Text |
|
-> IO () |
Is emitted whenever a new message is popped off a statusbar's stack.
afterStatusbarTextPopped :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPoppedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the textPopped signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
statusbar #textPopped callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onStatusbarTextPopped :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPoppedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the textPopped signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
statusbar #textPopped callback
textPushed
type StatusbarTextPushedCallback Source #
= Word32 |
|
-> Text |
|
-> IO () |
Is emitted whenever a new message gets pushed onto a statusbar's stack.
afterStatusbarTextPushed :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPushedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the textPushed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
statusbar #textPushed callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onStatusbarTextPushed :: (IsStatusbar a, MonadIO m) => a -> ((?self :: a) => StatusbarTextPushedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the textPushed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
statusbar #textPushed callback