gi-gtk-3.0.41: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.InfoBar

Description

InfoBar is a widget that can be used to show messages to the user without showing a dialog. It is often temporarily shown at the top or bottom of a document. In contrast to Dialog, which has a action area at the bottom, InfoBar has an action area at the side.

The API of InfoBar is very similar to Dialog, allowing you to add buttons to the action area with infoBarAddButton or gtk_info_bar_new_with_buttons(). The sensitivity of action widgets can be controlled with infoBarSetResponseSensitive. To add widgets to the main content area of a InfoBar, use infoBarGetContentArea and add your widgets to the container.

Similar to MessageDialog, the contents of a InfoBar can by classified as error message, warning, informational message, etc, by using infoBarSetMessageType. GTK+ may use the message type to determine how the message is displayed.

A simple example for using a InfoBar:

C code

GtkWidget *widget, *message_label, *content_area;
GtkWidget *grid;
GtkInfoBar *bar;

// set up info bar
widget = gtk_info_bar_new ();
bar = GTK_INFO_BAR (widget);
grid = gtk_grid_new ();

gtk_widget_set_no_show_all (widget, TRUE);
message_label = gtk_label_new ("");
content_area = gtk_info_bar_get_content_area (bar);
gtk_container_add (GTK_CONTAINER (content_area),
                   message_label);
gtk_info_bar_add_button (bar,
                         _("_OK"),
                         GTK_RESPONSE_OK);
g_signal_connect (bar,
                  "response",
                  G_CALLBACK (gtk_widget_hide),
                  NULL);
gtk_grid_attach (GTK_GRID (grid),
                 widget,
                 0, 2, 1, 1);

// ...

// show an error message
gtk_label_set_text (GTK_LABEL (message_label), "An error occurred!");
gtk_info_bar_set_message_type (bar,
                               GTK_MESSAGE_ERROR);
gtk_widget_show (bar);

GtkInfoBar as GtkBuildable

The GtkInfoBar implementation of the GtkBuildable interface exposes the content area and action area as internal children with the names “content_area” and “action_area”.

GtkInfoBar supports a custom <action-widgets> element, which can contain multiple <action-widget> elements. The “response” attribute specifies a numeric response, and the content of the element is the id of widget (which should be a child of the dialogs actionArea).

CSS nodes

GtkInfoBar has a single CSS node with name infobar. The node may get one of the style classes .info, .warning, .error or .question, depending on the message type.

Synopsis

Exported types

newtype InfoBar Source #

Memory-managed wrapper type.

Constructors

InfoBar (ManagedPtr InfoBar) 

Instances

Instances details
Eq InfoBar Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

Methods

(==) :: InfoBar -> InfoBar -> Bool #

(/=) :: InfoBar -> InfoBar -> Bool #

GObject InfoBar Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

ManagedPtrNewtype InfoBar Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

Methods

toManagedPtr :: InfoBar -> ManagedPtr InfoBar

TypedObject InfoBar Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

Methods

glibType :: IO GType

HasParentTypes InfoBar Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

IsGValue (Maybe InfoBar) Source #

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

Instance details

Defined in GI.Gtk.Objects.InfoBar

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes InfoBar Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

type ParentTypes InfoBar = '[Box, Container, Widget, Object, ImplementorIface, Buildable, Orientable]

class (GObject o, IsDescendantOf InfoBar o) => IsInfoBar o Source #

Type class for types which can be safely cast to InfoBar, for instance with toInfoBar.

Instances

Instances details
(GObject o, IsDescendantOf InfoBar o) => IsInfoBar o Source # 
Instance details

Defined in GI.Gtk.Objects.InfoBar

toInfoBar :: (MonadIO m, IsInfoBar o) => o -> m InfoBar Source #

Cast to InfoBar, 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

activate, add, addAccelerator, addActionWidget, addButton, 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, propagateDraw, queryChildPacking, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reorderChild, reparent, resetRcStyles, resetStyle, resizeChildren, response, 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, getActionArea, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBaselinePosition, getBorderWidth, getCanDefault, getCanFocus, getCenterWidget, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getContentArea, 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, getMessageType, 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, getRevealed, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getShowCloseButton, 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, setDefaultResponse, 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, setMessageType, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setResponseSensitive, setRevealed, setSensitive, setShowCloseButton, setSizeRequest, setSpacing, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

addActionWidget

infoBarAddActionWidget Source #

Arguments

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

infoBar: a InfoBar

-> b

child: an activatable widget

-> Int32

responseId: response ID for child

-> m () 

Add an activatable widget to the action area of a InfoBar, connecting a signal handler that will emit the InfoBar::response signal on the message area when the widget is activated. The widget is appended to the end of the message areas action area.

Since: 2.18

addButton

infoBarAddButton Source #

Arguments

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

infoBar: a InfoBar

-> Text

buttonText: text of button

-> Int32

responseId: response ID for the button

-> m Button

Returns: the Button widget that was added

Adds a button with the given text and sets things up so that clicking the button will emit the “response” signal with the given response_id. The button is appended to the end of the info bars's action area. The button widget is returned, but usually you don't need it.

Since: 2.18

getActionArea

infoBarGetActionArea Source #

Arguments

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

infoBar: a InfoBar

-> m Box

Returns: the action area

Returns the action area of infoBar.

Since: 2.18

getContentArea

infoBarGetContentArea Source #

Arguments

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

infoBar: a InfoBar

-> m Box

Returns: the content area

Returns the content area of infoBar.

Since: 2.18

getMessageType

infoBarGetMessageType Source #

Arguments

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

infoBar: a InfoBar

-> m MessageType

Returns: the message type of the message area.

Returns the message type of the message area.

Since: 2.18

getRevealed

infoBarGetRevealed Source #

Arguments

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

infoBar: a InfoBar

-> m Bool

Returns: the current value of the GtkInfoBar:revealed property.

No description available in the introspection data.

Since: 3.22.29

getShowCloseButton

infoBarGetShowCloseButton Source #

Arguments

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

infoBar: a InfoBar

-> m Bool

Returns: True if the widget displays standard close button

Returns whether the widget will display a standard close button.

Since: 3.10

new

infoBarNew Source #

Arguments

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

Returns: a new InfoBar object

Creates a new InfoBar object.

Since: 2.18

response

infoBarResponse Source #

Arguments

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

infoBar: a InfoBar

-> Int32

responseId: a response ID

-> m () 

Emits the “response” signal with the given responseId.

Since: 2.18

setDefaultResponse

infoBarSetDefaultResponse Source #

Arguments

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

infoBar: a InfoBar

-> Int32

responseId: a response ID

-> m () 

Sets the last widget in the info bar’s action area with the given response_id as the default widget for the dialog. Pressing “Enter” normally activates the default widget.

Note that this function currently requires infoBar to be added to a widget hierarchy.

Since: 2.18

setMessageType

infoBarSetMessageType Source #

Arguments

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

infoBar: a InfoBar

-> MessageType

messageType: a MessageType

-> m () 

Sets the message type of the message area.

GTK+ uses this type to determine how the message is displayed.

Since: 2.18

setResponseSensitive

infoBarSetResponseSensitive Source #

Arguments

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

infoBar: a InfoBar

-> Int32

responseId: a response ID

-> Bool

setting: TRUE for sensitive

-> m () 

Calls gtk_widget_set_sensitive (widget, setting) for each widget in the info bars’s action area with the given response_id. A convenient way to sensitize/desensitize dialog buttons.

Since: 2.18

setRevealed

infoBarSetRevealed Source #

Arguments

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

infoBar: a InfoBar

-> Bool

revealed: The new value of the property

-> m () 

Sets the GtkInfoBar:revealed property to revealed. This will cause infoBar to show up with a slide-in transition.

Note that this property does not automatically show infoBar and thus won’t have any effect if it is invisible.

Since: 3.22.29

setShowCloseButton

infoBarSetShowCloseButton Source #

Arguments

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

infoBar: a InfoBar

-> Bool

setting: True to include a close button

-> m () 

If true, a standard close button is shown. When clicked it emits the response ResponseTypeClose.

Since: 3.10

Properties

messageType

The type of the message.

The type may be used to determine the appearance of the info bar.

Since: 2.18

constructInfoBarMessageType :: (IsInfoBar o, MonadIO m) => MessageType -> m (GValueConstruct o) Source #

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

getInfoBarMessageType :: (MonadIO m, IsInfoBar o) => o -> m MessageType Source #

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

get infoBar #messageType

setInfoBarMessageType :: (MonadIO m, IsInfoBar o) => o -> MessageType -> m () Source #

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

set infoBar [ #messageType := value ]

revealed

No description available in the introspection data.

constructInfoBarRevealed :: (IsInfoBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getInfoBarRevealed :: (MonadIO m, IsInfoBar o) => o -> m Bool Source #

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

get infoBar #revealed

setInfoBarRevealed :: (MonadIO m, IsInfoBar o) => o -> Bool -> m () Source #

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

set infoBar [ #revealed := value ]

showCloseButton

Whether to include a standard close button.

Since: 3.10

constructInfoBarShowCloseButton :: (IsInfoBar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getInfoBarShowCloseButton :: (MonadIO m, IsInfoBar o) => o -> m Bool Source #

Get the value of the “show-close-button” property. When overloading is enabled, this is equivalent to

get infoBar #showCloseButton

setInfoBarShowCloseButton :: (MonadIO m, IsInfoBar o) => o -> Bool -> m () Source #

Set the value of the “show-close-button” property. When overloading is enabled, this is equivalent to

set infoBar [ #showCloseButton := value ]

Signals

close

type InfoBarCloseCallback = IO () Source #

The close signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user uses a keybinding to dismiss the info bar.

The default binding for this signal is the Escape key.

Since: 2.18

afterInfoBarClose :: (IsInfoBar a, MonadIO m) => a -> ((?self :: a) => InfoBarCloseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the close signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after infoBar #close 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.

onInfoBarClose :: (IsInfoBar a, MonadIO m) => a -> ((?self :: a) => InfoBarCloseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the close signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on infoBar #close callback

response

type InfoBarResponseCallback Source #

Arguments

 = Int32

responseId: the response ID

-> IO () 

Emitted when an action widget is clicked or the application programmer calls dialogResponse. The responseId depends on which action widget was clicked.

Since: 2.18

afterInfoBarResponse :: (IsInfoBar a, MonadIO m) => a -> ((?self :: a) => InfoBarResponseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the response signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after infoBar #response 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.

onInfoBarResponse :: (IsInfoBar a, MonadIO m) => a -> ((?self :: a) => InfoBarResponseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the response signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on infoBar #response callback