Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: InfoBarResponseCallback

[528:7] extends: object

Generated low-level callback wrapper for GIR callback response.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • InfoBarResponseCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, response_id, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: InfoBar

[48:7] extends: object

GtkInfoBar can be used to show messages to the user without a dialog. An example GtkInfoBar It is often temporarily shown at the top or bottom of a document. In contrast to [class@Gtk.Dialog], which has an 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 [method@Gtk.InfoBar.add_button] or [ctor@Gtk.InfoBar.new_with_buttons]. The sensitivity of action widgets can be controlled with [method@Gtk.InfoBar.set_response_sensitive]. To add widgets to the main content area of a GtkInfoBar, use [method@Gtk.InfoBar.add_child]. Similar to [class@Gtk.MessageDialog], the contents of a GtkInfoBar can by classified as error message, warning, informational message, etc, by using [method@Gtk.InfoBar.set_message_type]. GTK may use the message type to determine how the message is displayed. A simple example for using a GtkInfoBar: c GtkWidget *message_label; GtkWidget *widget; GtkWidget *grid; GtkInfoBar *bar; // set up info bar widget = gtk_info_bar_new (); bar = GTK_INFO_BAR (widget); grid = gtk_grid_new (); message_label = gtk_label_new (""); gtk_info_bar_add_child (bar, 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 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). GtkInfoBar supports adding action widgets by specifying “action” as the “type” attribute of a <child> element. The widget will be added either to the action area. The response id has to be associated with the action widget using the <action-widgets> element. # 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. If the info bar shows a close button, that button will have the .close style class applied.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • InfoBar ()

    Creates a new GtkInfoBar object.

  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asWidget ()

    Wraps this handle as Widget.

    • @r A Widget object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnClose (callback Fn, UserData = null)

    Gets emitted when the user uses a keybinding to dismiss the info bar. The ::close signal is a keybinding signal. The default binding for this signal is the Escape key.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (InfoBar Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnResponse (callback Fn, UserData = null)

    Emitted when an action widget is clicked. The signal is also emitted when the application programmer calls [method@Gtk.InfoBar.response]. The

    • @response_id depends on which action widget was clicked.
    • @p Fn is the Aussom callback.
    • @p Fn is called with (InfoBar Self, string Response_id).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setMessagetype (string Value)

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

    • @p Value is the new property value.
    • @r None.
  • setRevealed (bool Value)

    Whether the info bar shows its contents.

    • @p Value is the new property value.
    • @r None.
  • setShowclosebutton (bool Value)

    Whether to include a standard close button.

    • @p Value is the new property value.
    • @r None.
  • add_action_widget (object child, string response_id)

    Add an activatable widget to the action area of a GtkInfoBar. This also connects a signal handler that will emit the [signal@Gtk.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.

    • @p child is an activatable widget.
    • @p response_id is response ID for @child.
    • @r None.
  • add_button (string button_text, string response_id)

    Adds a button with the given text. Clicking the button will emit the [signal@Gtk.InfoBar::response] signal with the given response_id. The button is appended to the end of the info bar's action area. The button widget is returned, but usually you don't need it.

    • @p button_text is text of button.
    • @p response_id is response ID for the button.
  • add_child (object widget)

    Adds a widget to the content area of the info bar.

    • @p widget is the child to be added.
    • @r None.
  • get_message_type ()

    Returns the message type of the message area.

  • get_revealed ()

    Returns whether the info bar is currently revealed.

  • get_show_close_button ()

    Returns whether the widget will display a standard close button.

  • remove_action_widget (object widget)

    Removes a widget from the action area of @info_bar. The widget must have been put there by a call to [method@Gtk.InfoBar.add_action_widget] or [method@Gtk.InfoBar.add_button].

    • @p widget is an action widget to remove.
    • @r None.
  • remove_child (object widget)

    Removes a widget from the content area of the info bar.

    • @p widget is a child that has been added to the content area.
    • @r None.
  • response (string response_id)

    Emits the “response” signal with the given @response_id.

    • @p response_id is a response ID.
    • @r None.
  • set_default_response (string response_id)

    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.

    • @p response_id is a response ID.
    • @r None.
  • set_message_type (string message_type)

    Sets the message type of the message area. GTK uses this type to determine how the message is displayed.

    • @p message_type is a GtkMessageType.
    • @r None.
  • set_response_sensitive (string response_id, bool setting)

    Sets the sensitivity of action widgets for @response_id. 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 buttons.

    • @p response_id is a response ID.
    • @p setting is TRUE for sensitive.
    • @r None.
  • set_revealed (bool revealed)

    Sets whether the GtkInfoBar is revealed. Changing this will make

    • @info_bar reveal or conceal itself via a sliding transition. Note: this does not show or hide @info_bar in the [property@Gtk.Widget:visible] sense, so revealing has no effect if [property@Gtk.Widget:visible] is %FALSE.
    • @p revealed is The new value of the property.
    • @r None.
  • set_show_close_button (bool setting)

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

    • @p setting is %TRUE to include a close button.
    • @r None.

class: InfoBarCloseCallback

[458:7] extends: object

Generated low-level callback wrapper for GIR callback close.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • InfoBarCloseCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: InfoBarMeta

[599:14] static extends: object

Generated metadata helpers for InfoBar class surfaces.

Methods

  • properties ()

    Returns property metadata for InfoBar.

    • @r A list.
  • signals ()

    Returns signal metadata for InfoBar.

    • @r A list.