Package: gtk

Class gtk:info-bar

Superclasses

Documented Subclasses

None

Direct Slots

message-type
The message-type property of type gtk:message-type (Read / Write / Construct)
The type of the message. The type may be used to determine the appearance of the info bar.
Default value: :info
revealed
The revealed property of type :boolean (Read / Write)
Controls whether the action bar shows its contents or not.
Default value: true
show-close-button
The show-close-button property of type :boolean (Read / Write / Construct)
Whether to include a standard Close button.
Default value: false

Details

The gtk:info-bar widget 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 the gtk:dialog widget, which has a horizontal action area at the bottom, the info bar has a vertical action area at the side.

Figure: GtkInfoBar

The API of the gtk:info-bar widget is very similar to the gtk:dialog widget, allowing you to add buttons to the action area with the gtk:info-bar-add-button or gtk:info-bar-new-with-buttons functions. The sensitivity of action widgets can be controlled with the gtk:info-bar-set-response-sensitive function. To add widgets to the main content area of an info bar, use the gtk:info-bar-add-child function.

Similar to the gtk:message-dialog widget, the contents of an info bar can by classified as error message, warning, informational message, and so on, by using the gtk:info-bar-message-type function. GTK may use the message type to determine how the message is displayed.

Examples

Simple info bar usage.
(defun create-info-bar (msg type)
  (let ((infobar (make-instance 'gtk:info-bar
                                :message-type type
                                :show-close-button t))
        (message (make-instance 'gtk:label :label msg)))
    ;; Add a label with the message to the content of the info bar
    (gtk:info-bar-add-child infobar message)
    ;; Connect a signal handler to the info bar
    (g:signal-connect infobar "response"
                      (lambda (widget response)
                        (declare (ignore response))
                        (gtk:widget-hide widget)))
    infobar))    

GtkInfoBar as GtkBuildable

The gtk:info-bar implementation of the gtk:buildable interface exposes the content area and action area as internal children with the names content_area and action_area.

The gtk:info-bar implementation 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 the widget, which should be a child of the dialogs action area.

CSS nodes

The gtk:info-bar implementation has a single CSS node with name infobar. The node may get one of the .info, .warning, .error or .question style classes, depending on the message type. If the info bar shows a Close button, that button will have the .close style class applied.

Warning

The gtk:info-bar implementation is deprecated since 4.10. Do not use it in newly written code. There is no replacement in GTK for an "info bar" widget. You can use the gtk:revealer widget with a gtk:box widget containing a gtk:label widget and an optional gtk:button widget, according to your design of the application.

Signal Details

The "close" signal
lambda (infobar)    :action      
infobar
The gtk:info-bar widget on which the signal is emitted.
The 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.
The "response" signal
lambda (infobar response)    :run-last      
infobar
The gtk:info-bar widget on which the signal is emitted.
response
The integer with the response ID.
Emitted when an action widget is clicked or the application programmer calls the gtk:dialog-response function. The response argument depends on which action widget was clicked.
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2025-3-13