InfoBar

GtkInfoBar 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 GtkDialog, which has a action area at the bottom, GtkInfoBar has an action area at the side.

The API of GtkInfoBar is very similar to GtkDialog, allowing you to add buttons to the action area with gtk_info_bar_add_button() or gtk_info_bar_new_with_buttons(). The sensitivity of action widgets can be controlled with gtk_info_bar_set_response_sensitive(). To add widgets to the main content area of a GtkInfoBar, use gtk_info_bar_get_content_area() and add your widgets to the container.

Similar to GtkMessageDialog, the contents of a GtkInfoBar can by classified as error message, warning, informational message, etc, by using gtk_info_bar_set_message_type(). GTK+ may use the message type to determine how the message is displayed.

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 action_area).

Constructors

this
this(GtkInfoBar* gtkInfoBar)

Sets our main struct and passes it to the parent class

this
this(string[] buttonsText, ResponseType[] responses)
this
this(StockID[] stockIDs, ResponseType[] responses)
this
this()

Creates a new GtkInfoBar object. Since 2.18

Members

Functions

addActionWidget
void addActionWidget(Widget child, int responseId)

Add an activatable widget to the action area of a GtkInfoBar, connecting a signal handler that will emit the "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
Button addButton(StockID stockID, int responseId)
addButton
Widget addButton(string buttonText, int responseId)

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

addButtons
void addButtons(string[] buttonsText, ResponseType[] responses)
addButtons
void addButtons(StockID[] stockIDs, ResponseType[] responses)
addOnClose
void addOnClose(void delegate(InfoBar) dlg, ConnectFlags connectFlags)

The ::close signal is a keybinding signal 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

addOnResponse
void addOnResponse(void delegate(gint, InfoBar) dlg, ConnectFlags connectFlags)

Emitted when an action widget is clicked or the application programmer calls gtk_dialog_response(). The response_id depends on which action widget was clicked. Since 2.18 See Also GtkStatusbar, GtkMessageDialog

getActionArea
VButtonBox getActionArea()

Returns the action area of info_bar. Since 2.18

getContentArea
HBox getContentArea()

Returns the content area of info_bar. Since 2.18

getInfoBarStruct
GtkInfoBar* getInfoBarStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getMessageType
GtkMessageType getMessageType()

Returns the message type of the message area. Since 2.18

getShowCloseButton
int getShowCloseButton()

Returns whether the widget will display a standard close button.

getStruct
void* getStruct()

the main Gtk struct as a void*

response
void response(int responseId)

Emits the 'response' signal with the given response_id. Since 2.18

setDefaultResponse
void setDefaultResponse(int responseId)

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 info_bar to be added to a widget hierarchy. Since 2.18

setMessageType
void setMessageType(GtkMessageType messageType)

Sets the message type of the message area. GTK+ uses this type to determine what color to use when drawing the message area. Since 2.18

setResponseSensitive
void setResponseSensitive(int responseId, int setting)

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

setShowCloseButton
void setShowCloseButton(int setting)

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

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

callBackClose
void callBackClose(GtkInfoBar* arg0Struct, InfoBar _infoBar)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackResponse
void callBackResponse(GtkInfoBar* infoBarStruct, gint responseId, InfoBar _infoBar)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkInfoBar
GtkInfoBar* gtkInfoBar;

the main Gtk struct

onCloseListeners
void delegate(InfoBar)[] onCloseListeners;
Undocumented in source.
onResponseListeners
void delegate(gint, InfoBar)[] onResponseListeners;
Undocumented in source.

Inherited Members

From Box

gtkBox
GtkBox* gtkBox;

the main Gtk struct

getBoxStruct
GtkBox* getBoxStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
__anonymous
mixin OrientableT!(GtkBox)
Undocumented in source.
packStart
void packStart(Widget child, int expand, int fill, uint padding)

Adds child to box, packed with reference to the start of box. The child is packed after any other child packed with reference to the start of box.

packEnd
void packEnd(Widget child, int expand, int fill, uint padding)

Adds child to box, packed with reference to the end of box. The child is packed after (away from end of) any other child packed with reference to the end of box.

getHomogeneous
int getHomogeneous()

Returns whether the box is homogeneous (all children are the same size). See gtk_box_set_homogeneous().

setHomogeneous
void setHomogeneous(int homogeneous)

Sets the "homogeneous" property of box, controlling whether or not all children of box are given equal space in the box.

getSpacing
int getSpacing()

Gets the value set by gtk_box_set_spacing().

setSpacing
void setSpacing(int spacing)

Sets the "spacing" property of box, which is the number of pixels to place between children of box.

reorderChild
void reorderChild(Widget child, int position)

Moves child to a new position in the list of box children. The list is the children field of GtkBox, and contains both widgets packed GTK_PACK_START as well as widgets packed GTK_PACK_END, in the order that these widgets were added to box. A widget's position in the box children list determines where the widget is packed into box. A child widget at some position in the list will be packed just after all other widgets of the same packing type that appear earlier in the list.

queryChildPacking
void queryChildPacking(Widget child, int expand, int fill, uint padding, GtkPackType packType)

Obtains information about how child is packed into box.

setChildPacking
void setChildPacking(Widget child, int expand, int fill, uint padding, GtkPackType packType)

Sets the way child is packed into box.

getBaselinePosition
GtkBaselinePosition getBaselinePosition()

Gets the value set by gtk_box_set_baseline_position().

setBaselinePosition
void setBaselinePosition(GtkBaselinePosition position)

Sets the baseline position of a box. This affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space availible than requested, and the baseline is not allocated by the parent then position is used to allocate the baseline wrt the extra space available.

Meta