Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
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.
- newtype Statusbar = Statusbar (ManagedPtr Statusbar)
- class GObject o => IsStatusbar o
- toStatusbar :: IsStatusbar o => o -> IO Statusbar
- noStatusbar :: Maybe Statusbar
- data StatusbarGetContextIdMethodInfo
- statusbarGetContextId :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Text -> m Word32
- data StatusbarGetMessageAreaMethodInfo
- statusbarGetMessageArea :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> m Box
- statusbarNew :: (HasCallStack, MonadIO m) => m Statusbar
- data StatusbarPopMethodInfo
- statusbarPop :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> m ()
- data StatusbarPushMethodInfo
- statusbarPush :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> Text -> m Word32
- data StatusbarRemoveMethodInfo
- statusbarRemove :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> Word32 -> m ()
- data StatusbarRemoveAllMethodInfo
- statusbarRemoveAll :: (HasCallStack, MonadIO m, IsStatusbar a) => a -> Word32 -> m ()
- type C_StatusbarTextPoppedCallback = Ptr () -> Word32 -> CString -> Ptr () -> IO ()
- type StatusbarTextPoppedCallback = Word32 -> Text -> IO ()
- data StatusbarTextPoppedSignalInfo
- afterStatusbarTextPopped :: (GObject a, MonadIO m) => a -> StatusbarTextPoppedCallback -> m SignalHandlerId
- genClosure_StatusbarTextPopped :: StatusbarTextPoppedCallback -> IO Closure
- mk_StatusbarTextPoppedCallback :: C_StatusbarTextPoppedCallback -> IO (FunPtr C_StatusbarTextPoppedCallback)
- noStatusbarTextPoppedCallback :: Maybe StatusbarTextPoppedCallback
- onStatusbarTextPopped :: (GObject a, MonadIO m) => a -> StatusbarTextPoppedCallback -> m SignalHandlerId
- wrap_StatusbarTextPoppedCallback :: StatusbarTextPoppedCallback -> Ptr () -> Word32 -> CString -> Ptr () -> IO ()
- type C_StatusbarTextPushedCallback = Ptr () -> Word32 -> CString -> Ptr () -> IO ()
- type StatusbarTextPushedCallback = Word32 -> Text -> IO ()
- data StatusbarTextPushedSignalInfo
- afterStatusbarTextPushed :: (GObject a, MonadIO m) => a -> StatusbarTextPushedCallback -> m SignalHandlerId
- genClosure_StatusbarTextPushed :: StatusbarTextPushedCallback -> IO Closure
- mk_StatusbarTextPushedCallback :: C_StatusbarTextPushedCallback -> IO (FunPtr C_StatusbarTextPushedCallback)
- noStatusbarTextPushedCallback :: Maybe StatusbarTextPushedCallback
- onStatusbarTextPushed :: (GObject a, MonadIO m) => a -> StatusbarTextPushedCallback -> m SignalHandlerId
- wrap_StatusbarTextPushedCallback :: StatusbarTextPushedCallback -> Ptr () -> Word32 -> CString -> Ptr () -> IO ()
Exported types
GObject Statusbar Source # | |
IsImplementorIface Statusbar Source # | |
IsObject Statusbar Source # | |
IsWidget Statusbar Source # | |
IsContainer Statusbar Source # | |
IsBox Statusbar Source # | |
IsOrientable Statusbar Source # | |
IsBuildable Statusbar Source # | |
IsStatusbar Statusbar Source # | |
((~) * info (ResolveStatusbarMethod t Statusbar), MethodInfo * info Statusbar p) => IsLabel t (Statusbar -> p) Source # | |
((~) * info (ResolveStatusbarMethod t Statusbar), MethodInfo * info Statusbar p) => IsLabelProxy t (Statusbar -> p) Source # | |
HasAttributeList * Statusbar Source # | |
type AttributeList Statusbar Source # | |
type SignalList Statusbar Source # | |
class GObject o => IsStatusbar o Source #
toStatusbar :: IsStatusbar o => o -> IO Statusbar Source #
Methods
getContextId
data StatusbarGetContextIdMethodInfo Source #
((~) * signature (Text -> m Word32), MonadIO m, IsStatusbar a) => MethodInfo * StatusbarGetContextIdMethodInfo a signature Source # | |
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
data StatusbarGetMessageAreaMethodInfo Source #
((~) * signature (m Box), MonadIO m, IsStatusbar a) => MethodInfo * StatusbarGetMessageAreaMethodInfo a signature Source # | |
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
data StatusbarPopMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsStatusbar a) => MethodInfo * StatusbarPopMethodInfo a signature Source # | |
:: (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
data StatusbarPushMethodInfo Source #
((~) * signature (Word32 -> Text -> m Word32), MonadIO m, IsStatusbar a) => MethodInfo * StatusbarPushMethodInfo a signature Source # | |
:: (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
data StatusbarRemoveMethodInfo Source #
((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsStatusbar a) => MethodInfo * StatusbarRemoveMethodInfo a signature Source # | |
:: (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
data StatusbarRemoveAllMethodInfo Source #
((~) * signature (Word32 -> m ()), MonadIO m, IsStatusbar a) => MethodInfo * StatusbarRemoveAllMethodInfo a signature Source # | |
:: (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
afterStatusbarTextPopped :: (GObject a, MonadIO m) => a -> StatusbarTextPoppedCallback -> m SignalHandlerId Source #
mk_StatusbarTextPoppedCallback :: C_StatusbarTextPoppedCallback -> IO (FunPtr C_StatusbarTextPoppedCallback) Source #
onStatusbarTextPopped :: (GObject a, MonadIO m) => a -> StatusbarTextPoppedCallback -> m SignalHandlerId Source #
wrap_StatusbarTextPoppedCallback :: StatusbarTextPoppedCallback -> Ptr () -> Word32 -> CString -> Ptr () -> IO () Source #
textPushed
afterStatusbarTextPushed :: (GObject a, MonadIO m) => a -> StatusbarTextPushedCallback -> m SignalHandlerId Source #
mk_StatusbarTextPushedCallback :: C_StatusbarTextPushedCallback -> IO (FunPtr C_StatusbarTextPushedCallback) Source #
onStatusbarTextPushed :: (GObject a, MonadIO m) => a -> StatusbarTextPushedCallback -> m SignalHandlerId Source #
wrap_StatusbarTextPushedCallback :: StatusbarTextPushedCallback -> Ptr () -> Word32 -> CString -> Ptr () -> IO () Source #