Skip to main content

Dialog

Struct Dialog 

Source
pub struct Dialog { /* private fields */ }
Expand description

Dialog boxes are a convenient way to prompt the user for a small amount of input, e.g. to display a message, ask a question, or anything else that does not require extensive effort on the user’s part.

GTK+ treats a dialog as a window split vertically. The top section is a GtkVBox, and is where widgets such as a Label or a Entry should be packed. The bottom area is known as the “action area”. This is generally used for packing buttons into the dialog which may perform functions such as cancel, ok, or apply.

Dialog boxes are created with a call to new() or gtk_dialog_new_with_buttons(). gtk_dialog_new_with_buttons() is recommended; it allows you to set the dialog title, some convenient flags, and add simple buttons.

If “dialog” is a newly created dialog, the two primary areas of the window can be accessed through DialogExt::content_area() and gtk_dialog_get_action_area(), as can be seen from the example below.

A “modal” dialog (that is, one which freezes the rest of the application from user input), can be created by calling GtkWindowExt::set_modal() on the dialog. Use the GTK_WINDOW() macro to cast the widget returned from new() into a Window. When using gtk_dialog_new_with_buttons() you can also pass the DialogFlags::MODAL flag to make a dialog modal.

If you add buttons to Dialog using gtk_dialog_new_with_buttons(), DialogExt::add_button(), DialogExtManual::add_buttons(), or DialogExt::add_action_widget(), clicking the button will emit a signal called response with a response ID that you specified. GTK+ will never assign a meaning to positive response IDs; these are entirely user-defined. But for convenience, you can use the response IDs in the ResponseType enumeration (these all have values less than zero). If a dialog receives a delete event, the response signal will be emitted with a response ID of ResponseType::DeleteEvent.

If you want to block waiting for a dialog to return before returning control flow to your code, you can call DialogExt::run(). This function enters a recursive main loop and waits for the user to respond to the dialog, returning the response ID corresponding to the button the user clicked.

For the simple dialog in the following example, in reality you’d probably use MessageDialog to save yourself some effort. But you’d need to create the dialog contents manually if you had more than a simple message in the dialog.

An example for simple GtkDialog usage:

⚠️ The following code is in C ⚠️

// Function to open a dialog box with a message
void
quick_message (GtkWindow *parent, gchar *message)
{
 GtkWidget *dialog, *label, *content_area;
 GtkDialogFlags flags;

 // Create the widgets
 flags = GTK_DIALOG_DESTROY_WITH_PARENT;
 dialog = gtk_dialog_new_with_buttons ("Message",
                                       parent,
                                       flags,
                                       _("_OK"),
                                       GTK_RESPONSE_NONE,
                                       NULL);
 content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 label = gtk_label_new (message);

 // Ensure that the dialog box is destroyed when the user responds

 g_signal_connect_swapped (dialog,
                           "response",
                           G_CALLBACK (gtk_widget_destroy),
                           dialog);

 // Add the label, and show everything we’ve added

 gtk_container_add (GTK_CONTAINER (content_area), label);
 gtk_widget_show_all (dialog);
}

§GtkDialog as GtkBuildable

The GtkDialog implementation of the Buildable interface exposes the vbox and action_area as internal children with the names “vbox” and “action_area”.

GtkDialog 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). To mark a response as default, set the “default“ attribute of the <action-widget> element to true.

GtkDialog 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 or the headerbar of the dialog, depending on the “use-header-bar“ property. The response id has to be associated with the action widget using the <action-widgets> element.

An example of a Dialog UI definition fragment:

⚠️ The following code is in xml ⚠️

<object class="GtkDialog" id="dialog1">
  <child type="action">
    <object class="GtkButton" id="button_cancel"/>
  </child>
  <child type="action">
    <object class="GtkButton" id="button_ok">
      <property name="can-default">True</property>
    </object>
  </child>
  <action-widgets>
    <action-widget response="cancel">button_cancel</action-widget>
    <action-widget response="ok" default="true">button_ok</action-widget>
  </action-widgets>
</object>

§Properties

§use-header-bar

true if the dialog uses a HeaderBar for action buttons instead of the action-area.

For technical reasons, this property is declared as an integer property, but you should only set it to true or false.

Readable | Writeable | Construct Only

Window

§accept-focus

Whether the window should receive the input focus.

Readable | Writeable

§application

The Application associated with the window.

The application will be kept alive for at least as long as it has any windows associated with it (see ApplicationExtManual::hold() for a way to keep it alive without windows).

Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the :application property to None.

Readable | Writeable

§attached-to

The widget to which this window is attached. See GtkWindowExt::set_attached_to().

Examples of places where specifying this relation is useful are for instance a Menu created by a ComboBox, a completion popup window created by Entry or a typeahead search entry created by TreeView.

Readable | Writeable | Construct

§decorated

Whether the window should be decorated by the window manager.

Readable | Writeable

§default-height

Readable | Writeable

§default-width

Readable | Writeable

§deletable

Whether the window frame should have a close button.

Readable | Writeable

§destroy-with-parent

Readable | Writeable

§focus-on-map

Whether the window should receive the input focus when mapped.

Readable | Writeable

§focus-visible

Whether ‘focus rectangles’ are currently visible in this window.

This property is maintained by GTK+ based on user input and should not be set by applications.

Readable | Writeable

§gravity

The window gravity of the window. See GtkWindowExt::move_() and gdk::Gravity for more details about window gravity.

Readable | Writeable

§has-resize-grip

Whether the window has a corner resize grip.

Note that the resize grip is only shown if the window is actually resizable and not maximized. Use resize-grip-visible to find out if the resize grip is currently shown.

Readable | Writeable

§has-toplevel-focus

Readable

§hide-titlebar-when-maximized

Whether the titlebar should be hidden during maximization.

Readable | Writeable

§icon

Readable | Writeable

§icon-name

The :icon-name property specifies the name of the themed icon to use as the window icon. See IconTheme for more details.

Readable | Writeable

§is-active

Readable

§is-maximized

Readable

§mnemonics-visible

Whether mnemonics are currently visible in this window.

This property is maintained by GTK+ based on user input, and should not be set by applications.

Readable | Writeable

Readable | Writeable

§resizable

Readable | Writeable

§resize-grip-visible

Whether a corner resize grip is currently shown.

Readable

§role

Readable | Writeable

§screen

Readable | Writeable

§skip-pager-hint

Readable | Writeable

§skip-taskbar-hint

Readable | Writeable

§startup-id

The :startup-id is a write-only property for setting window’s startup notification identifier. See GtkWindowExt::set_startup_id() for more details.

Writeable

§title

Readable | Writeable

§transient-for

The transient parent of the window. See GtkWindowExt::set_transient_for() for more details about transient windows.

Readable | Writeable | Construct

§type

Readable | Writeable | Construct Only

§type-hint

Readable | Writeable

§urgency-hint

Readable | Writeable

§window-position

Readable | Writeable

Container

§border-width

Readable | Writeable

§child

Writeable

§resize-mode

Readable | Writeable

Widget

§app-paintable

Readable | Writeable

§can-default

Readable | Writeable

§can-focus

Readable | Writeable

§composite-child

Readable

§double-buffered

Whether the widget is double buffered.

Readable | Writeable

§events

Readable | Writeable

§expand

Whether to expand in both directions. Setting this sets both hexpand and vexpand

Readable | Writeable

§focus-on-click

Whether the widget should grab focus when it is clicked with the mouse.

This property is only relevant for widgets that can take focus.

Before 3.20, several widgets (GtkButton, GtkFileChooserButton, GtkComboBox) implemented this property individually.

Readable | Writeable

§halign

How to distribute horizontal space if widget gets extra space, see Align

Readable | Writeable

§has-default

Readable | Writeable

§has-focus

Readable | Writeable

§has-tooltip

Enables or disables the emission of query-tooltip on widget. A value of true indicates that widget can have a tooltip, in this case the widget will be queried using query-tooltip to determine whether it will provide a tooltip or not.

Note that setting this property to true for the first time will change the event masks of the GdkWindows of this widget to include leave-notify and motion-notify events. This cannot and will not be undone when the property is set to false again.

Readable | Writeable

§height-request

Readable | Writeable

§hexpand

Whether to expand horizontally. See WidgetExt::set_hexpand().

Readable | Writeable

§hexpand-set

Whether to use the hexpand property. See WidgetExt::is_hexpand_set().

Readable | Writeable

§is-focus

Readable | Writeable

§margin

Sets all four sides’ margin at once. If read, returns max margin on any side.

Readable | Writeable

§margin-bottom

Margin on bottom side of widget.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from WidgetExt::set_size_request() for example.

Readable | Writeable

§margin-end

Margin on end of widget, horizontally. This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from WidgetExt::set_size_request() for example.

Readable | Writeable

§margin-left

Margin on left side of widget.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from WidgetExt::set_size_request() for example.

Readable | Writeable

§margin-right

Margin on right side of widget.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from WidgetExt::set_size_request() for example.

Readable | Writeable

§margin-start

Margin on start of widget, horizontally. This property supports left-to-right and right-to-left text directions.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from WidgetExt::set_size_request() for example.

Readable | Writeable

§margin-top

Margin on top side of widget.

This property adds margin outside of the widget’s normal size request, the margin will be added in addition to the size from WidgetExt::set_size_request() for example.

Readable | Writeable

§name

Readable | Writeable

§no-show-all

Readable | Writeable

§opacity

The requested opacity of the widget. See WidgetExt::set_opacity() for more details about window opacity.

Before 3.8 this was only available in GtkWindow

Readable | Writeable

§parent

Readable | Writeable

§receives-default

Readable | Writeable

§scale-factor

The scale factor of the widget. See WidgetExt::scale_factor() for more details about widget scaling.

Readable

§sensitive

Readable | Writeable

§style

The style of the widget, which contains information about how it will look (colors, etc).

Readable | Writeable

§tooltip-markup

Sets the text of tooltip to be the given string, which is marked up with the [Pango text markup language][PangoMarkupFormat]. Also see Tooltip::set_markup().

This is a convenience property which will take care of getting the tooltip shown if the given string is not None: has-tooltip will automatically be set to true and there will be taken care of query-tooltip in the default signal handler.

Note that if both tooltip-text and tooltip-markup are set, the last one wins.

Readable | Writeable

§tooltip-text

Sets the text of tooltip to be the given string.

Also see Tooltip::set_text().

This is a convenience property which will take care of getting the tooltip shown if the given string is not None: has-tooltip will automatically be set to true and there will be taken care of query-tooltip in the default signal handler.

Note that if both tooltip-text and tooltip-markup are set, the last one wins.

Readable | Writeable

§valign

How to distribute vertical space if widget gets extra space, see Align

Readable | Writeable

§vexpand

Whether to expand vertically. See WidgetExt::set_vexpand().

Readable | Writeable

§vexpand-set

Whether to use the vexpand property. See WidgetExt::is_vexpand_set().

Readable | Writeable

§visible

Readable | Writeable

§width-request

Readable | Writeable

§window

The widget’s window if it is realized, None otherwise.

Readable

§Signals

§close

The ::close signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user uses a keybinding to close the dialog.

The default binding for this signal is the Escape key.

Action

§response

Emitted when an action widget is clicked, the dialog receives a delete event, or the application programmer calls DialogExt::response(). On a delete event, the response ID is ResponseType::DeleteEvent. Otherwise, it depends on which action widget was clicked.

Window

§activate-default

The ::activate-default signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user activates the default widget of window.

Action

§activate-focus

The ::activate-focus signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user activates the currently focused widget of window.

Action

§enable-debugging

The ::enable-debugging signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user enables or disables interactive debugging. When toggle is true, interactive debugging is toggled on or off, when it is false, the debugger will be pointed at the widget under the pointer.

The default bindings for this signal are Ctrl-Shift-I and Ctrl-Shift-D.

Action

§keys-changed

The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with window changes.

§set-focus

This signal is emitted whenever the currently focused widget in this window changes.

Container

§add
§check-resize
§remove
§set-focus-child

Widget

§accel-closures-changed
§button-press-event

The ::button-press-event signal will be emitted when a button (typically from a mouse) is pressed.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::BUTTON_PRESS_MASK mask.

This signal will be sent to the grab widget if there is one.

§button-release-event

The ::button-release-event signal will be emitted when a button (typically from a mouse) is released.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::BUTTON_RELEASE_MASK mask.

This signal will be sent to the grab widget if there is one.

§can-activate-accel

Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This signal is present to allow applications and derived widgets to override the default Widget handling for determining whether an accelerator can be activated.

§child-notify

The ::child-notify signal is emitted for each [child property][child-properties] that has changed on an object. The signal’s detail holds the property name.

Detailed

§composited-changed

The ::composited-changed signal is emitted when the composited status of widgets screen changes. See Screen::is_composited().

Action

§configure-event

The ::configure-event signal will be emitted when the size, position or stacking of the widget’s window has changed.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

§damage-event

Emitted when a redirected window belonging to widget gets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into.

§delete-event

The ::delete-event signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Connecting WidgetExtManual::hide_on_delete() to this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it.

§destroy

Signals that all holders of a reference to the widget should release the reference that they hold. May result in finalization of the widget if all references are released.

This signal is not suitable for saving widget state.

§destroy-event

The ::destroy-event signal is emitted when a gdk::Window is destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

§direction-changed

The ::direction-changed signal is emitted when the text direction of a widget changes.

§drag-begin

The ::drag-begin signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with e.g. WidgetExt::drag_source_set_icon_pixbuf().

Note that some widgets set up a drag icon in the default handler of this signal, so you may have to use g_signal_connect_after() to override what the default handler did.

§drag-data-delete

The ::drag-data-delete signal is emitted on the drag source when a drag with the action gdk::DragAction::MOVE is successfully completed. The signal handler is responsible for deleting the data that has been dropped. What “delete” means depends on the context of the drag operation.

§drag-data-get

The ::drag-data-get signal is emitted on the drag source when the drop site requests the data which is dragged. It is the responsibility of the signal handler to fill data with the data in the format which is indicated by info. See SelectionData::set() and SelectionData::set_text().

§drag-data-received

The ::drag-data-received signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call gdk_drag_status() and not finish the drag. If the data was received in response to a drag-drop signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call gtk_drag_finish(), setting the success parameter depending on whether the data was processed successfully.

Applications must create some means to determine why the signal was emitted and therefore whether to call gdk_drag_status() or gtk_drag_finish().

The handler may inspect the selected action with DragContext::selected_action() before calling gtk_drag_finish(), e.g. to implement gdk::DragAction::ASK as shown in the following example:

⚠️ The following code is in C ⚠️

void
drag_data_received (GtkWidget          *widget,
                    GdkDragContext     *context,
                    gint                x,
                    gint                y,
                    GtkSelectionData   *data,
                    guint               info,
                    guint               time)
{
  if ((data->length >= 0) && (data->format == 8))
    {
      GdkDragAction action;

      // handle data here

      action = gdk_drag_context_get_selected_action (context);
      if (action == GDK_ACTION_ASK)
        {
          GtkWidget *dialog;
          gint response;

          dialog = gtk_message_dialog_new (NULL,
                                           GTK_DIALOG_MODAL |
                                           GTK_DIALOG_DESTROY_WITH_PARENT,
                                           GTK_MESSAGE_INFO,
                                           GTK_BUTTONS_YES_NO,
                                           "Move the data ?\n");
          response = gtk_dialog_run (GTK_DIALOG (dialog));
          gtk_widget_destroy (dialog);

          if (response == GTK_RESPONSE_YES)
            action = GDK_ACTION_MOVE;
          else
            action = GDK_ACTION_COPY;
         }

      gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
    }
  else
    gtk_drag_finish (context, FALSE, FALSE, time);
 }
§drag-drop

The ::drag-drop signal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler must ensure that gtk_drag_finish() is called to let the source know that the drop is done. The call to gtk_drag_finish() can be done either directly or in a drag-data-received handler which gets triggered by calling WidgetExt::drag_get_data() to receive the data for one or more of the supported targets.

§drag-end

The ::drag-end signal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in drag-begin.

§drag-failed

The ::drag-failed signal is emitted on the drag source when a drag has failed. The signal handler may hook custom code to handle a failed DnD operation based on the type of error, it returns true is the failure has been already handled (not showing the default “drag operation failed” animation), otherwise it returns false.

§drag-leave

The ::drag-leave signal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done in drag-motion, e.g. undo highlighting with WidgetExt::drag_unhighlight().

Likewise, the drag-leave signal is also emitted before the ::drag-drop signal, for instance to allow cleaning up of a preview item created in the drag-motion signal handler.

§drag-motion

The ::drag-motion signal is emitted on the drop site when the user moves the cursor over the widget during a drag. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by calling gdk_drag_status().

If the decision whether the drop will be accepted or rejected can’t be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling WidgetExt::drag_get_data() and defer the gdk_drag_status() call to the drag-data-received handler. Note that you must pass DestDefaults::DROP, DestDefaults::MOTION or DestDefaults::ALL to WidgetExtManual::drag_dest_set() when using the drag-motion signal that way.

Also note that there is no drag-enter signal. The drag receiver has to keep track of whether he has received any drag-motion signals since the last drag-leave and if not, treat the drag-motion signal as an “enter” signal. Upon an “enter”, the handler will typically highlight the drop site with WidgetExt::drag_highlight().

⚠️ The following code is in C ⚠️

static void
drag_motion (GtkWidget      *widget,
             GdkDragContext *context,
             gint            x,
             gint            y,
             guint           time)
{
  GdkAtom target;

  PrivateData *private_data = GET_PRIVATE_DATA (widget);

  if (!private_data->drag_highlight)
   {
     private_data->drag_highlight = 1;
     gtk_drag_highlight (widget);
   }

  target = gtk_drag_dest_find_target (widget, context, NULL);
  if (target == GDK_NONE)
    gdk_drag_status (context, 0, time);
  else
   {
     private_data->pending_status
        = gdk_drag_context_get_suggested_action (context);
     gtk_drag_get_data (widget, context, target, time);
   }

  return TRUE;
}

static void
drag_data_received (GtkWidget        *widget,
                    GdkDragContext   *context,
                    gint              x,
                    gint              y,
                    GtkSelectionData *selection_data,
                    guint             info,
                    guint             time)
{
  PrivateData *private_data = GET_PRIVATE_DATA (widget);

  if (private_data->suggested_action)
   {
     private_data->suggested_action = 0;

     // We are getting this data due to a request in drag_motion,
     // rather than due to a request in drag_drop, so we are just
     // supposed to call gdk_drag_status(), not actually paste in
     // the data.

     str = gtk_selection_data_get_text (selection_data);
     if (!data_is_acceptable (str))
       gdk_drag_status (context, 0, time);
     else
       gdk_drag_status (context,
                        private_data->suggested_action,
                        time);
   }
  else
   {
     // accept the drop
   }
}
§draw

This signal is emitted when a widget is supposed to render itself. The widget’s top left corner must be painted at the origin of the passed in context and be sized to the values returned by WidgetExt::allocated_width() and WidgetExt::allocated_height().

Signal handlers connected to this signal can modify the cairo context passed as cr in any way they like and don’t need to restore it. The signal emission takes care of calling cairo_save() before and cairo_restore() after invoking the handler.

The signal handler will get a cr with a clip region already set to the widget’s dirty region, i.e. to the area that needs repainting. Complicated widgets that want to avoid redrawing themselves completely can get the full extents of the clip region with gdk_cairo_get_clip_rectangle(), or they can get a finer-grained representation of the dirty region with cairo_copy_clip_rectangle_list().

§enter-notify-event

The ::enter-notify-event will be emitted when the pointer enters the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::ENTER_NOTIFY_MASK mask.

This signal will be sent to the grab widget if there is one.

§event

The GTK+ main loop will emit three signals for each GDK event delivered to a widget: one generic ::event signal, another, more specific, signal that matches the type of event delivered (e.g. key-press-event) and finally a generic event-after signal.

§event-after

After the emission of the event signal and (optionally) the second more specific signal, ::event-after will be emitted regardless of the previous two signals handlers return values.

§focus
§focus-in-event

The ::focus-in-event signal will be emitted when the keyboard focus enters the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::FOCUS_CHANGE_MASK mask.

§focus-out-event

The ::focus-out-event signal will be emitted when the keyboard focus leaves the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::FOCUS_CHANGE_MASK mask.

§grab-broken-event

Emitted when a pointer or keyboard grab on a window belonging to widget gets broken.

On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again.

§grab-focus

Action

§grab-notify

The ::grab-notify signal is emitted when a widget becomes shadowed by a GTK+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed.

A widget is shadowed by a WidgetExt::grab_add() when the topmost grab widget in the grab stack of its window group is not its ancestor.

§hide

The ::hide signal is emitted when widget is hidden, for example with WidgetExt::hide().

§hierarchy-changed

The ::hierarchy-changed signal is emitted when the anchored state of a widget changes. A widget is “anchored” when its toplevel ancestor is a Window. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa.

§key-press-event

The ::key-press-event signal is emitted when a key is pressed. The signal emission will reoccur at the key-repeat rate when the key is kept pressed.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::KEY_PRESS_MASK mask.

This signal will be sent to the grab widget if there is one.

§key-release-event

The ::key-release-event signal is emitted when a key is released.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::KEY_RELEASE_MASK mask.

This signal will be sent to the grab widget if there is one.

§keynav-failed

Gets emitted if keyboard navigation fails. See WidgetExt::keynav_failed() for details.

§leave-notify-event

The ::leave-notify-event will be emitted when the pointer leaves the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::LEAVE_NOTIFY_MASK mask.

This signal will be sent to the grab widget if there is one.

§map

The ::map signal is emitted when widget is going to be mapped, that is when the widget is visible (which is controlled with WidgetExt::set_visible()) and all its parents up to the toplevel widget are also visible. Once the map has occurred, map-event will be emitted.

The ::map signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of unmap.

§map-event

The ::map-event signal will be emitted when the widget’s window is mapped. A window is mapped when it becomes visible on the screen.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

§mnemonic-activate

The default handler for this signal activates widget if group_cycling is false, or just makes widget grab focus if group_cycling is true.

§motion-notify-event

The ::motion-notify-event signal is emitted when the pointer moves over the widget’s gdk::Window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::POINTER_MOTION_MASK mask.

This signal will be sent to the grab widget if there is one.

§move-focus

Action

§parent-set

The ::parent-set signal is emitted when a new parent has been set on a widget.

This signal gets emitted whenever a widget should pop up a context menu. This usually happens through the standard key binding mechanism; by pressing a certain key while a widget is focused, the user can cause the widget to pop up a menu. For example, the Entry widget creates a menu with clipboard commands. See the [Popup Menu Migration Checklist][checklist-popup-menu] for an example of how to use this signal.

Action

§property-notify-event

The ::property-notify-event signal will be emitted when a property on the widget’s window has been changed or deleted.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROPERTY_CHANGE_MASK mask.

§proximity-in-event

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROXIMITY_IN_MASK mask.

This signal will be sent to the grab widget if there is one.

§proximity-out-event

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROXIMITY_OUT_MASK mask.

This signal will be sent to the grab widget if there is one.

§query-tooltip

Emitted when has-tooltip is true and the hover timeout has expired with the cursor hovering “above” widget; or emitted when widget got focus in keyboard mode.

Using the given coordinates, the signal handler should determine whether a tooltip should be shown for widget. If this is the case true should be returned, false otherwise. Note that if keyboard_mode is true, the values of x and y are undefined and should not be used.

The signal handler is free to manipulate tooltip with the therefore destined function calls.

§realize

The ::realize signal is emitted when widget is associated with a gdk::Window, which means that WidgetExt::realize() has been called or the widget has been mapped (that is, it is going to be drawn).

§screen-changed

The ::screen-changed signal gets emitted when the screen of a widget has changed.

§scroll-event

The ::scroll-event signal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::SCROLL_MASK mask.

This signal will be sent to the grab widget if there is one.

§selection-clear-event

The ::selection-clear-event signal will be emitted when the the widget’s window has lost ownership of a selection.

§selection-get
§selection-notify-event
§selection-received
§selection-request-event

The ::selection-request-event signal will be emitted when another client requests ownership of the selection owned by the widget’s window.

§show

The ::show signal is emitted when widget is shown, for example with WidgetExt::show().

§show-help

Action

§size-allocate
§state-changed

The ::state-changed signal is emitted when the widget state changes. See gtk_widget_get_state().

§state-flags-changed

The ::state-flags-changed signal is emitted when the widget state changes, see WidgetExt::state_flags().

§style-set

The ::style-set signal is emitted when a new style has been set on a widget. Note that style-modifying functions like gtk_widget_modify_base() also cause this signal to be emitted.

Note that this signal is emitted for changes to the deprecated GtkStyle. To track changes to the StyleContext associated with a widget, use the style-updated signal.

§style-updated

The ::style-updated signal is a convenience signal that is emitted when the changed signal is emitted on the widget’s associated StyleContext as returned by WidgetExt::style_context().

Note that style-modifying functions like gtk_widget_override_color() also cause this signal to be emitted.

§touch-event
§unmap

The ::unmap signal is emitted when widget is going to be unmapped, which means that either it or any of its parents up to the toplevel widget have been set as hidden.

As ::unmap indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.

§unmap-event

The ::unmap-event signal will be emitted when the widget’s window is unmapped. A window is unmapped when it becomes invisible on the screen.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

§unrealize

The ::unrealize signal is emitted when the gdk::Window associated with widget is destroyed, which means that WidgetExt::unrealize() has been called or the widget has been unmapped (that is, it is going to be hidden).

§visibility-notify-event

The ::visibility-notify-event will be emitted when the widget’s window is obscured or unobscured.

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::VISIBILITY_NOTIFY_MASK mask.

§window-state-event

The ::window-state-event will be emitted when the state of the toplevel window associated to the widget changes.

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

§Implements

DialogExt, GtkWindowExt, BinExt, ContainerExt, WidgetExt, glib::ObjectExt, BuildableExt, DialogExtManual, [GtkWindowExtManual][trait@crate::prelude::GtkWindowExtManual], ContainerExtManual, WidgetExtManual, BuildableExtManual

Implementations§

Source§

impl Dialog

Source

pub const NONE: Option<&'static Dialog> = None

Source

pub fn new() -> Dialog

Creates a new dialog box.

Widgets should not be packed into this Window directly, but into the vbox and action_area, as described above.

§Returns

the new dialog as a Widget

Source

pub fn builder() -> DialogBuilder

Creates a new builder-pattern struct instance to construct Dialog objects.

This method returns an instance of DialogBuilder which can be used to create Dialog objects.

Source§

impl Dialog

Source

pub fn with_buttons<T: IsA<Window>>( title: Option<&str>, parent: Option<&T>, flags: DialogFlags, buttons: &[(&str, ResponseType)], ) -> Dialog

Creates a new Dialog with title title (or None for the default title; see GtkWindowExt::set_title()) and transient parent parent (or None for none; see GtkWindowExt::set_transient_for()). The flags argument can be used to make the dialog modal (DialogFlags::MODAL) and/or to have it destroyed along with its transient parent (DialogFlags::DESTROY_WITH_PARENT). After flags, button text/response ID pairs should be listed, with a None pointer ending the list. Button text can be arbitrary text. A response ID can be any positive number, or one of the values in the ResponseType enumeration. If the user clicks one of these dialog buttons, Dialog will emit the response signal with the corresponding response ID. If a Dialog receives the delete-event signal, it will emit ::response with a response ID of ResponseType::DeleteEvent. However, destroying a dialog does not emit the ::response signal; so be careful relying on ::response when using the DialogFlags::DESTROY_WITH_PARENT flag. Buttons are from left to right, so the first button in the list will be the leftmost button in the dialog.

Here’s a simple example:

⚠️ The following code is in C ⚠️

 GtkWidget *main_app_window; // Window the dialog should show up on
 GtkWidget *dialog;
 GtkDialogFlags flags = GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT;
 dialog = gtk_dialog_new_with_buttons ("My dialog",
                                       main_app_window,
                                       flags,
                                       _("_OK"),
                                       GTK_RESPONSE_ACCEPT,
                                       _("_Cancel"),
                                       GTK_RESPONSE_REJECT,
                                       NULL);
§title

Title of the dialog, or None

§parent

Transient parent of the dialog, or None

§flags

from DialogFlags

§first_button_text

text to go in first button, or None

§Returns

a new Dialog

Trait Implementations§

Source§

impl Clone for Dialog

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Dialog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Dialog

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Dialog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Dialog

Source§

impl HasParamSpec for Dialog

Source§

type ParamSpec = ParamSpecObject

Source§

type SetValue = Dialog

Preferred value to be used as setter for the associated ParamSpec.
Source§

type BuilderFn = fn(&str) -> ParamSpecObjectBuilder<'_, Dialog>

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl Hash for Dialog

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IsA<Bin> for Dialog

Source§

impl IsA<Buildable> for Dialog

Source§

impl IsA<Container> for Dialog

Source§

impl IsA<Dialog> for AboutDialog

Source§

impl IsA<Dialog> for AppChooserDialog

Source§

impl IsA<Dialog> for ColorChooserDialog

Source§

impl IsA<Dialog> for FileChooserDialog

Source§

impl IsA<Dialog> for FontChooserDialog

Source§

impl IsA<Dialog> for MessageDialog

Source§

impl IsA<Dialog> for RecentChooserDialog

Source§

impl IsA<Widget> for Dialog

Source§

impl IsA<Window> for Dialog

Source§

impl<T: DialogImpl> IsSubclassable<T> for Dialog

Source§

fn class_init(class: &mut Class<Self>)

Override the virtual methods of this class for the given subclass and do other class initialization. Read more
Source§

fn instance_init(instance: &mut InitializingObject<T>)

Instance specific initialization. Read more
Source§

impl Ord for Dialog

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl ParentClassIs for Dialog

Source§

impl<OT: ObjectType> PartialEq<OT> for Dialog

Source§

fn eq(&self, other: &OT) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<OT: ObjectType> PartialOrd<OT> for Dialog

Source§

fn partial_cmp(&self, other: &OT) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for Dialog

Source§

fn static_type() -> Type

Returns the type identifier of Self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<O> BinExt for O
where O: IsA<Bin>,

Source§

fn child(&self) -> Option<Widget>

Gets the child of the Bin, or None if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<O> BuildableExt for O
where O: IsA<Buildable>,

Source§

fn add_child( &self, builder: &impl IsA<Builder>, child: &impl IsA<Object>, type_: Option<&str>, )

Adds a child to self. type_ is an optional string describing how the child should be added. Read more
Source§

fn construct_child( &self, builder: &impl IsA<Builder>, name: &str, ) -> Option<Object>

Constructs a child of self with the name name. Read more
Source§

fn internal_child( &self, builder: &impl IsA<Builder>, childname: &str, ) -> Option<Object>

Get the internal child called childname of the self object. Read more
Source§

fn parser_finished(&self, builder: &impl IsA<Builder>)

Called when the builder finishes the parsing of a [GtkBuilder UI definition][BUILDER-UI]. Note that this will be called once for each time gtk_builder_add_from_file() or BuilderExtManual::add_from_string() is called on a builder. Read more
Source§

fn set_buildable_property( &self, builder: &impl IsA<Builder>, name: &str, value: &Value, )

Sets the property name name to value on the self object. Read more
Source§

impl<O> BuildableExtManual for O
where O: IsA<Buildable>,

Source§

impl<T> Cast for T
where T: ObjectType,

Source§

fn upcast<T>(self) -> T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a superclass or interface T. Read more
Source§

fn upcast_ref<T>(&self) -> &T
where T: ObjectType, Self: IsA<T>,

Upcasts an object to a reference of its superclass or interface T. Read more
Source§

fn downcast<T>(self) -> Result<T, Self>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a subclass or interface implementor T. Read more
Source§

fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType, Self: MayDowncastTo<T>,

Tries to downcast to a reference of its subclass or interface implementor T. Read more
Source§

fn dynamic_cast<T>(self) -> Result<T, Self>
where T: ObjectType,

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while upcast will do many checks at compile-time already. downcast will perform the same checks at runtime as dynamic_cast, but will also ensure some amount of compile-time safety. Read more
Source§

fn dynamic_cast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more
Source§

unsafe fn unsafe_cast<T>(self) -> T
where T: ObjectType,

Casts to T unconditionally. Read more
Source§

unsafe fn unsafe_cast_ref<T>(&self) -> &T
where T: ObjectType,

Casts to &T unconditionally. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<O> ContainerExt for O
where O: IsA<Container>,

Source§

fn add(&self, widget: &impl IsA<Widget>)

Adds widget to self. Typically used for simple containers such as Window, Frame, or Button; for more complicated layout containers such as Box or Grid, this function will pick default packing parameters that may not be correct. So consider functions such as BoxExt::pack_start() and GridExt::attach() as an alternative to add() in those cases. A widget may be added to only one container at a time; you can’t place the same widget inside two different containers. Read more
Source§

fn check_resize(&self)

Source§

fn child_notify(&self, child: &impl IsA<Widget>, child_property: &str)

Emits a child-notify signal for the [child property][child-properties] child_property on the child. Read more
Source§

fn child_notify_by_pspec( &self, child: &impl IsA<Widget>, pspec: impl AsRef<ParamSpec>, )

Emits a child-notify signal for the [child property][child-properties] specified by pspec on the child. Read more
Source§

fn child_type(&self) -> Type

Returns the type of the children supported by the container. Read more
Source§

fn forall<P: FnMut(&Widget)>(&self, callback: P)

Invokes callback on each direct child of self, including children that are considered “internal” (implementation details of the container). “Internal” children generally weren’t added by the user of the container, but were added by the container implementation itself. Read more
Source§

fn foreach<P: FnMut(&Widget)>(&self, callback: P)

Invokes callback on each non-internal child of self. See forall() for details on what constitutes an “internal” child. For all practical purposes, this function should iterate over precisely those child widgets that were added to the container by the application with explicit add() calls. Read more
Source§

fn border_width(&self) -> u32

Retrieves the border width of the container. See set_border_width(). Read more
Source§

fn children(&self) -> Vec<Widget>

Returns the container’s non-internal children. See forall() for details on what constitutes an “internal” child. Read more
Source§

fn focus_child(&self) -> Option<Widget>

Returns the current focus child widget inside self. This is not the currently focused widget. That can be obtained by calling GtkWindowExt::focused_widget(). Read more
Source§

fn focus_hadjustment(&self) -> Option<Adjustment>

Retrieves the horizontal focus adjustment for the container. See gtk_container_set_focus_hadjustment (). Read more
Source§

fn focus_vadjustment(&self) -> Option<Adjustment>

Retrieves the vertical focus adjustment for the container. See set_focus_vadjustment(). Read more
Source§

fn path_for_child(&self, child: &impl IsA<Widget>) -> Option<WidgetPath>

Returns a newly created widget path representing all the widget hierarchy from the toplevel down to and including child. Read more
Source§

fn propagate_draw(&self, child: &impl IsA<Widget>, cr: &Context)

When a container receives a call to the draw function, it must send synthetic draw calls to all children that don’t have their own GdkWindows. This function provides a convenient way of doing this. A container, when it receives a call to its draw function, calls propagate_draw() once for each child, passing in the cr the container received. Read more
Source§

fn remove(&self, widget: &impl IsA<Widget>)

Removes widget from self. widget must be inside self. Note that self will own a reference to widget, and that this may be the last reference held; so removing a widget from its container can destroy that widget. If you want to use widget again, you need to add a reference to it before removing it from a container, using g_object_ref(). If you don’t want to use widget again it’s usually more efficient to simply destroy it directly using gtk_widget_destroy() since this will remove it from the container and help break any circular reference count cycles. Read more
Source§

fn set_border_width(&self, border_width: u32)

Sets the border width of the container. Read more
Source§

fn set_focus_chain(&self, focusable_widgets: &[Widget])

👎Deprecated:

Since 3.24

Sets a focus chain, overriding the one computed automatically by GTK+. Read more
Source§

fn set_focus_child(&self, child: Option<&impl IsA<Widget>>)

Sets, or unsets if child is None, the focused child of self. Read more
Source§

fn set_focus_hadjustment(&self, adjustment: &impl IsA<Adjustment>)

Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the horizontal alignment. See ScrolledWindowExt::hadjustment() for a typical way of obtaining the adjustment and set_focus_vadjustment() for setting the vertical adjustment. Read more
Source§

fn set_focus_vadjustment(&self, adjustment: &impl IsA<Adjustment>)

Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the vertical alignment. See ScrolledWindowExt::vadjustment() for a typical way of obtaining the adjustment and set_focus_hadjustment() for setting the horizontal adjustment. Read more
Source§

fn unset_focus_chain(&self)

👎Deprecated:

Since 3.24

Removes a focus chain explicitly set with set_focus_chain(). Read more
Source§

fn set_child<P: IsA<Widget>>(&self, child: Option<&P>)

Source§

fn resize_mode(&self) -> ResizeMode

Source§

fn set_resize_mode(&self, resize_mode: ResizeMode)

Source§

fn connect_add<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_check_resize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_remove<F: Fn(&Self, &Widget) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_set_focus_child<F: Fn(&Self, &Widget) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_border_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_resize_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

impl<O> ContainerExtManual for O
where O: IsA<Container>,

Source§

fn child_property_value( &self, child: &impl IsA<Widget>, property_name: &str, ) -> Value

Source§

fn child_property<V: for<'b> FromValue<'b> + 'static>( &self, child: &impl IsA<Widget>, property_name: &str, ) -> V

Source§

fn child_set_property( &self, child: &impl IsA<Widget>, property_name: &str, value: &dyn ToValue, )

Sets a child property for child and self. Read more
Source§

impl<O> DialogExt for O
where O: IsA<Dialog>,

Source§

fn add_action_widget(&self, child: &impl IsA<Widget>, response_id: ResponseType)

Adds an activatable widget to the action area of a Dialog, connecting a signal handler that will emit the response signal on the dialog when the widget is activated. The widget is appended to the end of the dialog’s action area. If you want to add a non-activatable widget, simply pack it into the action_area field of the Dialog struct. Read more
Source§

fn add_button(&self, button_text: &str, response_id: ResponseType) -> Widget

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 dialog’s action area. The button widget is returned, but usually you don’t need it. Read more
Source§

fn content_area(&self) -> Box

Returns the content area of self. Read more
Source§

fn header_bar(&self) -> Option<HeaderBar>

Returns the header bar of self. Note that the headerbar is only used by the dialog if the use-header-bar property is true. Read more
Source§

fn response_for_widget(&self, widget: &impl IsA<Widget>) -> ResponseType

Gets the response id of a widget in the action area of a dialog. Read more
Source§

fn widget_for_response(&self, response_id: ResponseType) -> Option<Widget>

Gets the widget button that uses the given response ID in the action area of a dialog. Read more
Source§

fn response(&self, response_id: ResponseType)

Emits the response signal with the given response ID. Used to indicate that the user has responded to the dialog in some way; typically either you or run() will be monitoring the ::response signal and take appropriate action. Read more
Source§

fn run(&self) -> ResponseType

Blocks in a recursive main loop until the self either emits the response signal, or is destroyed. If the dialog is destroyed during the call to run(), run() returns ResponseType::None. Otherwise, it returns the response ID from the ::response signal emission. Read more
Source§

fn set_default_response(&self, response_id: ResponseType)

Sets the last widget in the dialog’s action area with the given response_id as the default widget for the dialog. Pressing “Enter” normally activates the default widget. Read more
Source§

fn set_response_sensitive(&self, response_id: ResponseType, setting: bool)

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

fn use_header_bar(&self) -> i32

true if the dialog uses a HeaderBar for action buttons instead of the action-area. Read more
Source§

fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::close signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user uses a keybinding to close the dialog. Read more
Source§

fn emit_close(&self)

Source§

fn connect_response<F: Fn(&Self, ResponseType) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when an action widget is clicked, the dialog receives a delete event, or the application programmer calls response(). On a delete event, the response ID is ResponseType::DeleteEvent. Otherwise, it depends on which action widget was clicked. Read more
Source§

impl<O> DialogExtManual for O
where O: IsA<Dialog> + IsA<Widget>,

Source§

fn add_buttons(&self, buttons: &[(&str, ResponseType)])

Adds more buttons, same as calling DialogExt::add_button() repeatedly. The variable argument list should be None-terminated as with gtk_dialog_new_with_buttons(). Each button must have both text and response ID. Read more
Source§

fn run_future<'a>(&'a self) -> Pin<Box<dyn Future<Output = ResponseType> + 'a>>

Shows the dialog and returns a Future that resolves to the ResponseType on response. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,

Source§

impl<O> GtkWindowExt for O
where O: IsA<Window>,

Source§

fn activate_default(&self) -> bool

Activates the default widget for the window, unless the current focused widget has been configured to receive the default action (see WidgetExt::set_receives_default()), in which case the focused widget is activated. Read more
Source§

fn activate_focus(&self) -> bool

Activates the current focused widget within the window. Read more
Source§

fn activate_key(&self, event: &EventKey) -> bool

Activates mnemonics and accelerators for this Window. This is normally called by the default ::key_press_event handler for toplevel windows, however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window. Read more
Source§

fn add_accel_group(&self, accel_group: &impl IsA<AccelGroup>)

Associate accel_group with self, such that calling accel_groups_activate() on self will activate accelerators in accel_group. Read more
Source§

fn add_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>)

Adds a mnemonic to this window. Read more
Source§

fn begin_move_drag(&self, button: i32, root_x: i32, root_y: i32, timestamp: u32)

Starts moving a window. This function is used if an application has window movement grips. When GDK can support it, the window movement will be done using the standard mechanism for the [window manager][gtk-X11-arch] or windowing system. Otherwise, GDK will try to emulate window movement, potentially not all that well, depending on the windowing system. Read more
Source§

fn begin_resize_drag( &self, edge: WindowEdge, button: i32, root_x: i32, root_y: i32, timestamp: u32, )

Starts resizing a window. This function is used if an application has window resizing controls. When GDK can support it, the resize will be done using the standard mechanism for the [window manager][gtk-X11-arch] or windowing system. Otherwise, GDK will try to emulate window resizing, potentially not all that well, depending on the windowing system. Read more
Source§

fn close(&self)

Requests that the window is closed, similar to what happens when a window manager close button is clicked. Read more
Source§

fn deiconify(&self)

Asks to deiconify (i.e. unminimize) the specified self. Note that you shouldn’t assume the window is definitely deiconified afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch])) could iconify it again before your code which assumes deiconification gets to run. Read more
Source§

fn fullscreen(&self)

Asks to place self in the fullscreen state. Note that you shouldn’t assume the window is definitely full screen afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could unfullscreen it again, and not all window managers honor requests to fullscreen windows. But normally the window will end up fullscreen. Just don’t write code that crashes if not. Read more
Source§

fn fullscreen_on_monitor(&self, screen: &Screen, monitor: i32)

Asks to place self in the fullscreen state. Note that you shouldn’t assume the window is definitely full screen afterward. Read more
Source§

fn accepts_focus(&self) -> bool

Gets the value set by set_accept_focus(). Read more
Source§

fn application(&self) -> Option<Application>

Gets the Application associated with the window (if any). Read more
Source§

fn attached_to(&self) -> Option<Widget>

Fetches the attach widget for this window. See set_attached_to(). Read more
Source§

fn is_decorated(&self) -> bool

Returns whether the window has been set to have decorations such as a title bar via set_decorated(). Read more
Source§

fn default_size(&self) -> (i32, i32)

Gets the default size of the window. A value of -1 for the width or height indicates that a default size has not been explicitly set for that dimension, so the “natural” size of the window will be used. Read more
Source§

fn default_widget(&self) -> Option<Widget>

Returns the default widget for self. See set_default() for more details. Read more
Source§

fn is_deletable(&self) -> bool

Returns whether the window has been set to have a close button via set_deletable(). Read more
Source§

fn must_destroy_with_parent(&self) -> bool

Returns whether the window will be destroyed with its transient parent. See gtk_window_set_destroy_with_parent (). Read more
Source§

fn focused_widget(&self) -> Option<Widget>

Retrieves the current focused widget within the window. Note that this is the widget that would have the focus if the toplevel window focused; if the toplevel window is not focused then gtk_widget_has_focus (widget) will not be true for the widget. Read more
Source§

fn gets_focus_on_map(&self) -> bool

Gets the value set by set_focus_on_map(). Read more
Source§

fn gets_focus_visible(&self) -> bool

Gets the value of the focus-visible property. Read more
Source§

fn gravity(&self) -> Gravity

Gets the value set by set_gravity(). Read more
Source§

fn group(&self) -> Option<WindowGroup>

Returns the group for self or the default group, if self is None or if self does not have an explicit window group. Read more
Source§

fn hides_titlebar_when_maximized(&self) -> bool

Returns whether the window has requested to have its titlebar hidden when maximized. See gtk_window_set_hide_titlebar_when_maximized (). Read more
Source§

fn icon(&self) -> Option<Pixbuf>

Gets the value set by set_icon() (or if you’ve called set_icon_list(), gets the first icon in the icon list). Read more
Source§

fn icon_list(&self) -> Vec<Pixbuf>

Retrieves the list of icons set by set_icon_list(). The list is copied, but the reference count on each member won’t be incremented. Read more
Source§

fn icon_name(&self) -> Option<GString>

Returns the name of the themed icon for the window, see set_icon_name(). Read more
Source§

fn mnemonic_modifier(&self) -> ModifierType

Returns the mnemonic modifier for this window. See set_mnemonic_modifier(). Read more
Source§

fn is_mnemonics_visible(&self) -> bool

Gets the value of the mnemonics-visible property. Read more
Source§

fn is_modal(&self) -> bool

Returns whether the window is modal. See set_modal(). Read more
Source§

fn position(&self) -> (i32, i32)

This function returns the position you need to pass to move_() to keep self in its current position. This means that the meaning of the returned value varies with window gravity. See move_() for more details. Read more
Source§

fn is_resizable(&self) -> bool

Gets the value set by set_resizable(). Read more
Source§

fn role(&self) -> Option<GString>

Returns the role of the window. See set_role() for further explanation. Read more
Source§

fn screen(&self) -> Option<Screen>

Returns the gdk::Screen associated with self. Read more
Source§

fn size(&self) -> (i32, i32)

Obtains the current size of self. Read more
Source§

fn skips_pager_hint(&self) -> bool

Gets the value set by set_skip_pager_hint(). Read more
Source§

fn skips_taskbar_hint(&self) -> bool

Gets the value set by set_skip_taskbar_hint() Read more
Source§

fn title(&self) -> Option<GString>

Retrieves the title of the window. See set_title(). Read more
Source§

fn titlebar(&self) -> Option<Widget>

Returns the custom titlebar that has been set with set_titlebar(). Read more
Source§

fn transient_for(&self) -> Option<Window>

Fetches the transient parent for this window. See set_transient_for(). Read more
Source§

fn type_hint(&self) -> WindowTypeHint

Gets the type hint for this window. See set_type_hint(). Read more
Source§

fn is_urgency_hint(&self) -> bool

Gets the value set by set_urgency_hint() Read more
Source§

fn window_type(&self) -> WindowType

Gets the type of the window. See WindowType. Read more
Source§

fn has_group(&self) -> bool

Returns whether self has an explicit window group. Read more
Source§

fn has_toplevel_focus(&self) -> bool

Returns whether the input focus is within this GtkWindow. For real toplevel windows, this is identical to is_active(), but for embedded windows, like Plug, the results will differ. Read more
Source§

fn iconify(&self)

Asks to iconify (i.e. minimize) the specified self. Note that you shouldn’t assume the window is definitely iconified afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could deiconify it again, or there may not be a window manager in which case iconification isn’t possible, etc. But normally the window will end up iconified. Just don’t write code that crashes if not. Read more
Source§

fn is_active(&self) -> bool

Returns whether the window is part of the current active toplevel. (That is, the toplevel window receiving keystrokes.) The return value is true if the window is active toplevel itself, but also if it is, say, a Plug embedded in the active toplevel. You might use this function if you wanted to draw a widget differently in an active window from a widget in an inactive window. See has_toplevel_focus() Read more
Source§

fn is_maximized(&self) -> bool

Retrieves the current maximized state of self. Read more
Source§

fn maximize(&self)

Asks to maximize self, so that it becomes full-screen. Note that you shouldn’t assume the window is definitely maximized afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could unmaximize it again, and not all window managers support maximization. But normally the window will end up maximized. Just don’t write code that crashes if not. Read more
Source§

fn mnemonic_activate(&self, keyval: u32, modifier: ModifierType) -> bool

Activates the targets associated with the mnemonic. Read more
Source§

fn move_(&self, x: i32, y: i32)

Source§

fn present(&self)

Presents a window to the user. This function should not be used as when it is called, it is too late to gather a valid timestamp to allow focus stealing prevention to work correctly.
Source§

fn present_with_time(&self, timestamp: u32)

Presents a window to the user. This may mean raising the window in the stacking order, deiconifying it, moving it to the current desktop, and/or giving it the keyboard focus, possibly dependent on the user’s platform, window manager, and preferences. Read more
Source§

fn propagate_key_event(&self, event: &EventKey) -> bool

Propagate a key press or release event to the focus widget and up the focus container chain until a widget handles event. This is normally called by the default ::key_press_event and ::key_release_event handlers for toplevel windows, however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window. Read more
Source§

fn remove_accel_group(&self, accel_group: &impl IsA<AccelGroup>)

Reverses the effects of add_accel_group(). Read more
Source§

fn remove_mnemonic(&self, keyval: u32, target: &impl IsA<Widget>)

Removes a mnemonic from this window. Read more
Source§

fn resize(&self, width: i32, height: i32)

Resizes the window as if the user had done so, obeying geometry constraints. The default geometry constraint is that windows may not be smaller than their size request; to override this constraint, call WidgetExt::set_size_request() to set the window’s request to a smaller value. Read more
Source§

fn set_accept_focus(&self, setting: bool)

Windows may set a hint asking the desktop environment not to receive the input focus. This function sets this hint. Read more
Source§

fn set_application(&self, application: Option<&impl IsA<Application>>)

Sets or unsets the Application associated with the window. Read more
Source§

fn set_attached_to(&self, attach_widget: Option<&impl IsA<Widget>>)

Marks self as attached to attach_widget. This creates a logical binding between the window and the widget it belongs to, which is used by GTK+ to propagate information such as styling or accessibility to self as if it was a children of attach_widget. Read more
Source§

fn set_decorated(&self, setting: bool)

By default, windows are decorated with a title bar, resize controls, etc. Some [window managers][gtk-X11-arch] allow GTK+ to disable these decorations, creating a borderless window. If you set the decorated property to false using this function, GTK+ will do its best to convince the window manager not to decorate the window. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling WidgetExt::show(). Read more
Source§

fn set_default(&self, default_widget: Option<&impl IsA<Widget>>)

The default widget is the widget that’s activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget for a Window. When setting (rather than unsetting) the default widget it’s generally easier to call WidgetExt::grab_default() on the widget. Before making a widget the default widget, you must call WidgetExt::set_can_default() on the widget you’d like to make the default. Read more
Source§

fn set_default_size(&self, width: i32, height: i32)

Sets the default size of a window. If the window’s “natural” size (its size request) is larger than the default, the default will be ignored. More generally, if the default size does not obey the geometry hints for the window (set_geometry_hints() can be used to set these explicitly), the default size will be clamped to the nearest permitted size. Read more
Source§

fn set_deletable(&self, setting: bool)

By default, windows have a close button in the window frame. Some [window managers][gtk-X11-arch] allow GTK+ to disable this button. If you set the deletable property to false using this function, GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling WidgetExt::show(). Read more
Source§

fn set_destroy_with_parent(&self, setting: bool)

If setting is true, then destroying the transient parent of self will also destroy self itself. This is useful for dialogs that shouldn’t persist beyond the lifetime of the main window they’re associated with, for example. Read more
Source§

fn set_focus(&self, focus: Option<&impl IsA<Widget>>)

If focus is not the current focus widget, and is focusable, sets it as the focus widget for the window. If focus is None, unsets the focus widget for this window. To set the focus to a particular widget in the toplevel, it is usually more convenient to use WidgetExt::grab_focus() instead of this function. Read more
Source§

fn set_focus_on_map(&self, setting: bool)

Windows may set a hint asking the desktop environment not to receive the input focus when the window is mapped. This function sets this hint. Read more
Source§

fn set_focus_visible(&self, setting: bool)

Sets the focus-visible property. Read more
Source§

fn set_geometry_hints( &self, geometry_widget: Option<&impl IsA<Widget>>, geometry: Option<&Geometry>, geom_mask: WindowHints, )

This function sets up hints about how a window can be resized by the user. You can set a minimum and maximum size; allowed resize increments (e.g. for xterm, you can only resize by the size of a character); aspect ratios; and more. See the gdk::Geometry struct. Read more
Source§

fn set_gravity(&self, gravity: Gravity)

Window gravity defines the meaning of coordinates passed to move_(). See move_() and gdk::Gravity for more details. Read more
Source§

fn set_has_user_ref_count(&self, setting: bool)

Tells GTK+ whether to drop its extra reference to the window when gtk_widget_destroy() is called. Read more
Source§

fn set_hide_titlebar_when_maximized(&self, setting: bool)

If setting is true, then self will request that it’s titlebar should be hidden when maximized. This is useful for windows that don’t convey any information other than the application name in the titlebar, to put the available screen space to better use. If the underlying window system does not support the request, the setting will not have any effect. Read more
Source§

fn set_icon(&self, icon: Option<&Pixbuf>)

Sets up the icon representing a Window. This icon is used when the window is minimized (also known as iconified). Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary. Read more
Source§

fn set_icon_from_file(&self, filename: impl AsRef<Path>) -> Result<(), Error>

Sets the icon for self. Warns on failure if err is None. Read more
Source§

fn set_icon_list(&self, list: &[Pixbuf])

Sets up the icon representing a Window. The icon is used when the window is minimized (also known as iconified). Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary. Read more
Source§

fn set_icon_name(&self, name: Option<&str>)

Sets the icon for the window from a named themed icon. See the docs for IconTheme for more details. On some platforms, the window icon is not used at all. Read more
Source§

fn set_keep_above(&self, setting: bool)

Asks to keep self above, so that it stays on top. Note that you shouldn’t assume the window is definitely above afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could not keep it above, and not all window managers support keeping windows above. But normally the window will end kept above. Just don’t write code that crashes if not. Read more
Source§

fn set_keep_below(&self, setting: bool)

Asks to keep self below, so that it stays in bottom. Note that you shouldn’t assume the window is definitely below afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could not keep it below, and not all window managers support putting windows below. But normally the window will be kept below. Just don’t write code that crashes if not. Read more
Source§

fn set_mnemonic_modifier(&self, modifier: ModifierType)

Sets the mnemonic modifier for this window. Read more
Source§

fn set_mnemonics_visible(&self, setting: bool)

Sets the mnemonics-visible property. Read more
Source§

fn set_modal(&self, modal: bool)

Sets a window modal or non-modal. Modal windows prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use set_transient_for() to make the dialog transient for the parent; most [window managers][gtk-X11-arch] will then disallow lowering the dialog below the parent. Read more
Source§

fn set_position(&self, position: WindowPosition)

Sets a position constraint for this window. If the old or new constraint is WindowPosition::CenterAlways, this will also cause the window to be repositioned to satisfy the new constraint. Read more
Source§

fn set_resizable(&self, resizable: bool)

Sets whether the user can resize a window. Windows are user resizable by default. Read more
Source§

fn set_role(&self, role: &str)

This function is only useful on X11, not with other GTK+ targets. Read more
Source§

fn set_screen(&self, screen: &Screen)

Sets the gdk::Screen where the self is displayed; if the window is already mapped, it will be unmapped, and then remapped on the new screen. Read more
Source§

fn set_skip_pager_hint(&self, setting: bool)

Windows may set a hint asking the desktop environment not to display the window in the pager. This function sets this hint. (A “pager” is any desktop navigation tool such as a workspace switcher that displays a thumbnail representation of the windows on the screen.) Read more
Source§

fn set_skip_taskbar_hint(&self, setting: bool)

Windows may set a hint asking the desktop environment not to display the window in the task bar. This function sets this hint. Read more
Source§

fn set_startup_id(&self, startup_id: &str)

Startup notification identifiers are used by desktop environment to track application startup, to provide user feedback and other features. This function changes the corresponding property on the underlying GdkWindow. Normally, startup identifier is managed automatically and you should only use this function in special cases like transferring focus from other processes. You should use this function before calling present() or any equivalent function generating a window map event. Read more
Source§

fn set_title(&self, title: &str)

Sets the title of the Window. The title of a window will be displayed in its title bar; on the X Window System, the title bar is rendered by the [window manager][gtk-X11-arch], so exactly how the title appears to users may vary according to a user’s exact configuration. The title should help a user distinguish this window from other windows they may have open. A good title might include the application name and current document filename, for example. Read more
Source§

fn set_titlebar(&self, titlebar: Option<&impl IsA<Widget>>)

Sets a custom titlebar for self. Read more
Source§

fn set_transient_for(&self, parent: Option<&impl IsA<Window>>)

Dialog windows should be set transient for the main application window they were spawned from. This allows [window managers][gtk-X11-arch] to e.g. keep the dialog on top of the main window, or center the dialog over the main window. gtk_dialog_new_with_buttons() and other convenience functions in GTK+ will sometimes call set_transient_for() on your behalf. Read more
Source§

fn set_type_hint(&self, hint: WindowTypeHint)

By setting the type hint for the window, you allow the window manager to decorate and handle the window in a way which is suitable to the function of the window in your application. Read more
Source§

fn set_urgency_hint(&self, setting: bool)

Windows may set a hint asking the desktop environment to draw the users attention to the window. This function sets this hint. Read more
Source§

fn stick(&self)

Asks to stick self, which means that it will appear on all user desktops. Note that you shouldn’t assume the window is definitely stuck afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch] could unstick it again, and some window managers do not support sticking windows. But normally the window will end up stuck. Just don’t write code that crashes if not. Read more
Source§

fn unfullscreen(&self)

Asks to toggle off the fullscreen state for self. Note that you shouldn’t assume the window is definitely not full screen afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could fullscreen it again, and not all window managers honor requests to unfullscreen windows. But normally the window will end up restored to its normal state. Just don’t write code that crashes if not. Read more
Source§

fn unmaximize(&self)

Asks to unmaximize self. Note that you shouldn’t assume the window is definitely unmaximized afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could maximize it again, and not all window managers honor requests to unmaximize. But normally the window will end up unmaximized. Just don’t write code that crashes if not. Read more
Source§

fn unstick(&self)

Asks to unstick self, which means that it will appear on only one of the user’s desktops. Note that you shouldn’t assume the window is definitely unstuck afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could stick it again. But normally the window will end up unstuck. Just don’t write code that crashes if not. Read more
Source§

fn default_height(&self) -> i32

Source§

fn set_default_height(&self, default_height: i32)

Source§

fn default_width(&self) -> i32

Source§

fn set_default_width(&self, default_width: i32)

Source§

fn type_(&self) -> WindowType

Source§

fn window_position(&self) -> WindowPosition

Source§

fn set_window_position(&self, window_position: WindowPosition)

Source§

fn connect_activate_default<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::activate-default signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user activates the default widget of window.
Source§

fn emit_activate_default(&self)

Source§

fn connect_activate_focus<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::activate-focus signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user activates the currently focused widget of window.
Source§

fn emit_activate_focus(&self)

Source§

fn connect_enable_debugging<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::enable-debugging signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user enables or disables interactive debugging. When toggle is true, interactive debugging is toggled on or off, when it is false, the debugger will be pointed at the widget under the pointer. Read more
Source§

fn emit_enable_debugging(&self, toggle: bool) -> bool

Source§

fn connect_keys_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with window changes.
Source§

fn connect_set_focus<F: Fn(&Self, Option<&Widget>) + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted whenever the currently focused widget in this window changes. Read more
Source§

fn connect_accept_focus_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_application_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_attached_to_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_decorated_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_default_height_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_default_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_deletable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_destroy_with_parent_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_focus_on_map_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_focus_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_gravity_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_has_toplevel_focus_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_hide_titlebar_when_maximized_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_icon_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_is_active_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_is_maximized_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_mnemonics_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_modal_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_resizable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_role_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_screen_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_skip_pager_hint_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_skip_taskbar_hint_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_startup_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_transient_for_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_type_hint_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_urgency_hint_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_window_position_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

Source§

impl<U> IsSubclassableExt for U

Source§

impl<Super, Sub> MayDowncastTo<Sub> for Super
where Super: IsA<Super>, Sub: IsA<Super>,

Source§

impl<T> ObjectExt for T
where T: ObjectType,

Source§

fn is<U>(&self) -> bool
where U: StaticType,

Returns true if the object is an instance of (can be cast to) T.
Source§

fn type_(&self) -> Type

Returns the type of the object.
Source§

fn object_class(&self) -> &Class<Object>

Returns the ObjectClass of the object. Read more
Source§

fn class(&self) -> &Class<T>
where T: IsClass,

Returns the class of the object.
Source§

fn class_of<U>(&self) -> Option<&Class<U>>
where U: IsClass,

Returns the class of the object in the given type T. Read more
Source§

fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>
where U: IsInterface,

Returns the interface T of the object. Read more
Source§

fn set_property(&self, property_name: &str, value: impl Into<Value>)

Sets the property property_name of the object to value value. Read more
Source§

fn set_property_from_value(&self, property_name: &str, value: &Value)

Sets the property property_name of the object to value value. Read more
Source§

fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])

Sets multiple properties of the object at once. Read more
Source§

fn set_properties_from_value(&self, property_values: &[(&str, Value)])

Sets multiple properties of the object at once. Read more
Source§

fn property<V>(&self, property_name: &str) -> V
where V: for<'b> FromValue<'b> + 'static,

Gets the property property_name of the object and cast it to the type V. Read more
Source§

fn property_value(&self, property_name: &str) -> Value

Gets the property property_name of the object. Read more
Source§

fn has_property(&self, property_name: &str, type_: Option<Type>) -> bool

Check if the object has a property property_name of the given type_. Read more
Source§

fn property_type(&self, property_name: &str) -> Option<Type>

Get the type of the property property_name of this object. Read more
Source§

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Get the ParamSpec of the property property_name of this object.
Source§

fn list_properties(&self) -> PtrSlice<ParamSpec>

Return all ParamSpec of the properties of this object.
Source§

fn freeze_notify(&self) -> PropertyNotificationFreezeGuard

Freeze all property notifications until the return guard object is dropped. Read more
Source§

unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
Source§

unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn set_data<QD>(&self, key: &str, value: QD)
where QD: 'static,

Set arbitrary data on this object with the given key. Read more
Source§

unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>
where QD: 'static,

Return previously set arbitrary data of this object with the given key. Read more
Source§

unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>
where QD: 'static,

Retrieve previously set arbitrary data of this object with the given key. Read more
Source§

fn block_signal(&self, handler_id: &SignalHandlerId)

Block a given signal handler. Read more
Source§

fn unblock_signal(&self, handler_id: &SignalHandlerId)

Unblock a given signal handler.
Source§

fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)

Stop emission of the currently emitted signal.
Source§

fn stop_signal_emission_by_name(&self, signal_name: &str)

Stop emission of the currently emitted signal by the (possibly detailed) signal name.
Source§

fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_name on this object. Read more
Source§

fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,

Connect to the signal signal_id on this object. Read more
Source§

fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_name on this object. Read more
Source§

fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value> + 'static,

Connect to the signal signal_id on this object. Read more
Source§

unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_name on this object. Read more
Source§

unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
where F: Fn(&[Value]) -> Option<Value>,

Connect to the signal signal_id on this object. Read more
Source§

fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_name on this object. Read more
Source§

fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId

Connect a closure to the signal signal_id on this object. Read more
Source§

fn watch_closure(&self, closure: &impl AsRef<Closure>)

Limits the lifetime of closure to the lifetime of the object. When the object’s reference count drops to zero, the closure will be invalidated. An invalidated closure will ignore any calls to invoke_with_values, or invoke when using Rust closures.
Source§

fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> R

Emit signal by signal id. Read more
Source§

fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>

Same as Self::emit but takes Value for the arguments.
Source§

fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> R

Emit signal by its name. Read more
Source§

fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>

Emit signal by its name. Read more
Source§

fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by its name with details. Read more
Source§

fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by its name with details. Read more
Source§

fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue], ) -> R

Emit signal by signal id with details. Read more
Source§

fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>

Emit signal by signal id with details. Read more
Source§

fn disconnect(&self, handler_id: SignalHandlerId)

Disconnect a previously connected signal handler.
Source§

fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + Send + Sync + 'static,

Connect to the notify signal of the object. Read more
Source§

fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
where F: Fn(&T, &ParamSpec) + 'static,

Connect to the notify signal of the object. Read more
Source§

unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
where F: Fn(&T, &ParamSpec),

Connect to the notify signal of the object. Read more
Source§

fn notify(&self, property_name: &str)

Notify that the given property has changed its value. Read more
Source§

fn notify_by_pspec(&self, pspec: &ParamSpec)

Notify that the given property has changed its value. Read more
Source§

fn downgrade(&self) -> WeakRef<T>

Downgrade this object to a weak reference.
Source§

fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + Send + 'static,

Add a callback to be notified when the Object is disposed.
Source§

fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>
where F: FnOnce() + 'static,

Add a callback to be notified when the Object is disposed. Read more
Source§

fn bind_property<'a, 'f, 't, O>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str, ) -> BindingBuilder<'a, 'f, 't>
where O: ObjectType,

Bind property source_property on this object to the target_property on the target object. Read more
Source§

fn ref_count(&self) -> u32

Returns the strong reference count of this object.
Source§

unsafe fn run_dispose(&self)

Runs the dispose mechanism of the object. Read more
Source§

impl<T> Property for T
where T: HasParamSpec,

Source§

type Value = T

Source§

impl<T> PropertyGet for T
where T: HasParamSpec,

Source§

type Value = T

Source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TransparentType for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<O> WidgetExt for O
where O: IsA<Widget>,

Source§

fn activate(&self) -> bool

For widgets that can be “activated” (buttons, menu items, etc.) this function activates them. Activation is what happens when you press Enter on a widget during key navigation. If self isn’t activatable, the function returns false. Read more
Source§

fn add_accelerator( &self, accel_signal: &str, accel_group: &impl IsA<AccelGroup>, accel_key: u32, accel_mods: ModifierType, accel_flags: AccelFlags, )

Installs an accelerator for this self in accel_group that causes accel_signal to be emitted if the accelerator is activated. The accel_group needs to be added to the widget’s toplevel via GtkWindowExt::add_accel_group(), and the signal must be of type G_SIGNAL_ACTION. Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use gtk_accel_map_add_entry() and set_accel_path() or GtkMenuItemExt::set_accel_path() instead. Read more
Source§

fn add_device_events(&self, device: &Device, events: EventMask)

Adds the device events in the bitfield events to the event mask for self. See set_device_events() for details. Read more
Source§

fn add_mnemonic_label(&self, label: &impl IsA<Widget>)

Adds a widget to the list of mnemonic labels for this widget. (See list_mnemonic_labels()). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well, by using a connection to the destroy signal or a weak notifier. Read more
Source§

fn can_activate_accel(&self, signal_id: u32) -> bool

Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This is done by emitting the can-activate-accel signal on self; if the signal isn’t overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped. Read more
Source§

fn child_focus(&self, direction: DirectionType) -> bool

This function is used by custom widget implementations; if you’re writing an app, you’d use grab_focus() to move the focus to a particular widget, and ContainerExt::set_focus_chain() to change the focus tab order. So you may want to investigate those functions instead. Read more
Source§

fn child_notify(&self, child_property: &str)

Emits a child-notify signal for the [child property][child-properties] child_property on self. Read more
Source§

fn compute_expand(&self, orientation: Orientation) -> bool

Computes whether a container should give this widget extra space when possible. Containers should check this, rather than looking at hexpands() or vexpands(). Read more
Source§

fn create_pango_context(&self) -> Context

Creates a new pango::Context with the appropriate font map, font options, font description, and base direction for drawing text for this widget. See also pango_context(). Read more
Source§

fn create_pango_layout(&self, text: Option<&str>) -> Layout

Creates a new pango::Layout with the appropriate font map, font description, and base direction for drawing text for this widget. Read more
Source§

fn device_is_shadowed(&self, device: &Device) -> bool

Returns true if device has been shadowed by a GTK+ device grab on another widget, so it would stop sending events to self. This may be used in the grab-notify signal to check for specific devices. See device_grab_add(). Read more
Source§

fn drag_begin_with_coordinates( &self, targets: &TargetList, actions: DragAction, button: i32, event: Option<&Event>, x: i32, y: i32, ) -> Option<DragContext>

Initiates a drag on the source side. The function only needs to be used when the application is starting drags itself, and is not needed when WidgetExtManual::drag_source_set() is used. Read more
Source§

fn drag_check_threshold( &self, start_x: i32, start_y: i32, current_x: i32, current_y: i32, ) -> bool

Checks to see if a mouse drag starting at (start_x, start_y) and ending at (current_x, current_y) has passed the GTK+ drag threshold, and thus should trigger the beginning of a drag-and-drop operation. Read more
Source§

fn drag_dest_add_image_targets(&self)

Add the image targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use TargetList::add_image_targets() and drag_dest_set_target_list().
Source§

fn drag_dest_add_text_targets(&self)

Add the text targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use TargetList::add_text_targets() and drag_dest_set_target_list().
Source§

fn drag_dest_add_uri_targets(&self)

Add the URI targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use TargetList::add_uri_targets() and drag_dest_set_target_list().
Source§

fn drag_dest_find_target( &self, context: &DragContext, target_list: Option<&TargetList>, ) -> Option<Atom>

Looks for a match between the supported targets of context and the dest_target_list, returning the first matching target, otherwise returning GDK_NONE. dest_target_list should usually be the return value from drag_dest_get_target_list(), but some widgets may have different valid targets for different parts of the widget; in that case, they will have to implement a drag_motion handler that passes the correct target list to this function. Read more
Source§

fn drag_dest_get_target_list(&self) -> Option<TargetList>

Returns the list of targets this widget can accept from drag-and-drop. Read more
Source§

fn drag_dest_get_track_motion(&self) -> bool

Returns whether the widget has been configured to always emit drag-motion signals. Read more
Source§

fn drag_dest_set_target_list(&self, target_list: Option<&TargetList>)

Sets the target types that this widget can accept from drag-and-drop. The widget must first be made into a drag destination with WidgetExtManual::drag_dest_set(). Read more
Source§

fn drag_dest_set_track_motion(&self, track_motion: bool)

Tells the widget to emit drag-motion and drag-leave events regardless of the targets and the DestDefaults::MOTION flag. Read more
Source§

fn drag_dest_unset(&self)

Clears information about a drop destination set with WidgetExtManual::drag_dest_set(). The widget will no longer receive notification of drags.
Source§

fn drag_get_data(&self, context: &DragContext, target: &Atom, time_: u32)

Gets the data associated with a drag. When the data is received or the retrieval fails, GTK+ will emit a drag-data-received signal. Failure of the retrieval is indicated by the length field of the selection_data signal parameter being negative. However, when drag_get_data() is called implicitely because the DestDefaults::DROP was set, then the widget will not receive notification of failed drops. Read more
Source§

fn drag_highlight(&self)

Highlights a widget as a currently hovered drop target. To end the highlight, call drag_unhighlight(). GTK+ calls this automatically if DestDefaults::HIGHLIGHT is set.
Source§

fn drag_source_add_image_targets(&self)

Add the writable image targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use TargetList::add_image_targets() and drag_source_set_target_list().
Source§

fn drag_source_add_text_targets(&self)

Add the text targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use TargetList::add_text_targets() and drag_source_set_target_list().
Source§

fn drag_source_add_uri_targets(&self)

Add the URI targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use TargetList::add_uri_targets() and drag_source_set_target_list().
Source§

fn drag_source_get_target_list(&self) -> Option<TargetList>

Gets the list of targets this widget can provide for drag-and-drop. Read more
Source§

fn drag_source_set_icon_gicon(&self, icon: &impl IsA<Icon>)

Sets the icon that will be used for drags from a particular source to icon. See the docs for IconTheme for more details. Read more
Source§

fn drag_source_set_icon_name(&self, icon_name: &str)

Sets the icon that will be used for drags from a particular source to a themed icon. See the docs for IconTheme for more details. Read more
Source§

fn drag_source_set_icon_pixbuf(&self, pixbuf: &Pixbuf)

Sets the icon that will be used for drags from a particular widget from a gdk_pixbuf::Pixbuf. GTK+ retains a reference for pixbuf and will release it when it is no longer needed. Read more
Source§

fn drag_source_set_target_list(&self, target_list: Option<&TargetList>)

Changes the target types that this widget offers for drag-and-drop. The widget must first be made into a drag source with WidgetExtManual::drag_source_set(). Read more
Source§

fn drag_source_unset(&self)

Undoes the effects of WidgetExtManual::drag_source_set().
Source§

fn drag_unhighlight(&self)

Removes a highlight set by drag_highlight() from a widget.
Source§

fn draw(&self, cr: &Context)

Draws self to cr. The top left corner of the widget will be drawn to the currently set origin point of cr. Read more
Source§

fn error_bell(&self)

Notifies the user about an input-related error on this widget. If the gtk-error-bell setting is true, it calls Window::beep(), otherwise it does nothing. Read more
Source§

fn event(&self, event: &Event) -> bool

Rarely-used function. This function is used to emit the event signals on a widget (those signals should never be emitted without using this function to do so). If you want to synthesize an event though, don’t use this function; instead, use main_do_event() so the event will behave as if it were in the event queue. Don’t synthesize expose events; instead, use Window::invalidate_rect() to invalidate a region of the window. Read more
Source§

fn freeze_child_notify(&self)

Stops emission of child-notify signals on self. The signals are queued until thaw_child_notify() is called on self. Read more
Source§

fn accessible(&self) -> Option<Object>

Returns the accessible object that describes the widget to an assistive technology. Read more
Source§

fn action_group(&self, prefix: &str) -> Option<ActionGroup>

Retrieves the gio::ActionGroup that was registered using prefix. The resulting gio::ActionGroup may have been registered to self or any Widget in its ancestry. Read more
Source§

fn allocated_baseline(&self) -> i32

Returns the baseline that has currently been allocated to self. This function is intended to be used when implementing handlers for the draw function, and when allocating child widgets in size_allocate. Read more
Source§

fn allocated_height(&self) -> i32

Returns the height that has currently been allocated to self. This function is intended to be used when implementing handlers for the draw function. Read more
Source§

fn allocated_size(&self) -> (Allocation, i32)

Retrieves the widget’s allocated size. Read more
Source§

fn allocated_width(&self) -> i32

Returns the width that has currently been allocated to self. This function is intended to be used when implementing handlers for the draw function. Read more
Source§

fn allocation(&self) -> Allocation

Retrieves the widget’s allocation. Read more
Source§

fn ancestor(&self, widget_type: Type) -> Option<Widget>

Gets the first ancestor of self with type widget_type. For example, gtk_widget_get_ancestor (widget, GTK_TYPE_BOX) gets the first Box that’s an ancestor of self. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevel Window in the docs for toplevel(). Read more
Source§

fn is_app_paintable(&self) -> bool

Determines whether the application intends to draw on the widget in an draw handler. Read more
Source§

fn can_default(&self) -> bool

Determines whether self can be a default widget. See set_can_default(). Read more
Source§

fn can_focus(&self) -> bool

Determines whether self can own the input focus. See set_can_focus(). Read more
Source§

fn is_child_visible(&self) -> bool

Gets the value set with set_child_visible(). If you feel a need to use this function, your code probably needs reorganization. Read more
Source§

fn clip(&self) -> Allocation

Retrieves the widget’s clip area. Read more
Source§

fn clipboard(&self, selection: &Atom) -> Clipboard

Returns the clipboard object for the given selection to be used with self. self must have a gdk::Display associated with it, so must be attached to a toplevel window. Read more
Source§

fn device_is_enabled(&self, device: &Device) -> bool

Returns whether device can interact with self and its children. See set_device_enabled(). Read more
Source§

fn device_events(&self, device: &Device) -> EventMask

Returns the events mask for the widget corresponding to an specific device. These are the events that the widget will receive when device operates on it. Read more
Source§

fn direction(&self) -> TextDirection

Gets the reading direction for a particular widget. See set_direction(). Read more
Source§

fn display(&self) -> Display

Get the gdk::Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top. Read more
Source§

fn is_double_buffered(&self) -> bool

Determines whether the widget is double buffered. Read more
Source§

fn gets_focus_on_click(&self) -> bool

Returns whether the widget should grab focus when it is clicked with the mouse. See set_focus_on_click(). Read more
Source§

fn font_map(&self) -> Option<FontMap>

Gets the font map that has been set with set_font_map(). Read more
Source§

fn font_options(&self) -> Option<FontOptions>

Returns the cairo::FontOptions used for Pango rendering. When not set, the defaults font options for the gdk::Screen will be used. Read more
Source§

fn frame_clock(&self) -> Option<FrameClock>

Obtains the frame clock for a widget. The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call FrameClock::frame_time(), in order to get a time to use for animating. For example you might record the start of the animation with an initial value from FrameClock::frame_time(), and then update the animation by calling FrameClock::frame_time() again during each repaint. Read more
Source§

fn halign(&self) -> Align

Gets the value of the halign property. Read more
Source§

fn has_tooltip(&self) -> bool

Returns the current value of the has-tooltip property. See has-tooltip for more information. Read more
Source§

fn has_window(&self) -> bool

Determines whether self has a gdk::Window of its own. See set_has_window(). Read more
Source§

fn hexpands(&self) -> bool

Gets whether the widget would like any available extra horizontal space. When a user resizes a Window, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand. Read more
Source§

fn is_hexpand_set(&self) -> bool

Gets whether set_hexpand() has been used to explicitly set the expand flag on this widget. Read more
Source§

fn is_mapped(&self) -> bool

Whether the widget is mapped. Read more
Source§

fn margin_bottom(&self) -> i32

Gets the value of the margin-bottom property. Read more
Source§

fn margin_end(&self) -> i32

Gets the value of the margin-end property. Read more
Source§

fn margin_start(&self) -> i32

Gets the value of the margin-start property. Read more
Source§

fn margin_top(&self) -> i32

Gets the value of the margin-top property. Read more
Source§

fn modifier_mask(&self, intent: ModifierIntent) -> ModifierType

Returns the modifier mask the self’s windowing system backend uses for a particular purpose. Read more
Source§

fn widget_name(&self) -> GString

Retrieves the name of a widget. See set_widget_name() for the significance of widget names. Read more
Source§

fn is_no_show_all(&self) -> bool

Returns the current value of the no-show-all property, which determines whether calls to show_all() will affect this widget. Read more
Source§

fn opacity(&self) -> f64

Fetches the requested opacity for this widget. See set_opacity(). Read more
Source§

fn pango_context(&self) -> Context

Gets a pango::Context with the appropriate font map, font description, and base direction for this widget. Unlike the context returned by create_pango_context(), this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget’s attributes. This can be tracked by using the screen-changed signal on the widget. Read more
Source§

fn parent(&self) -> Option<Widget>

Returns the parent container of self. Read more
Source§

fn parent_window(&self) -> Option<Window>

Gets self’s parent window, or None if it does not have one. Read more
Source§

fn path(&self) -> WidgetPath

Returns the WidgetPath representing self, if the widget is not connected to a toplevel widget, a partial path will be created. Read more
Source§

fn preferred_height(&self) -> (i32, i32)

Retrieves a widget’s initial minimum and natural height. Read more
Source§

fn preferred_height_and_baseline_for_width( &self, width: i32, ) -> (i32, i32, i32, i32)

Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given the specified width, or the default height if width is -1. The baselines may be -1 which means that no baseline is requested for this widget. Read more
Source§

fn preferred_height_for_width(&self, width: i32) -> (i32, i32)

Retrieves a widget’s minimum and natural height if it would be given the specified width. Read more
Source§

fn preferred_size(&self) -> (Requisition, Requisition)

Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management. Read more
Source§

fn preferred_width(&self) -> (i32, i32)

Retrieves a widget’s initial minimum and natural width. Read more
Source§

fn preferred_width_for_height(&self, height: i32) -> (i32, i32)

Retrieves a widget’s minimum and natural width if it would be given the specified height. Read more
Source§

fn is_realized(&self) -> bool

Determines whether self is realized. Read more
Source§

fn receives_default(&self) -> bool

Determines whether self is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default. Read more
Source§

fn request_mode(&self) -> SizeRequestMode

Gets whether the widget prefers a height-for-width layout or a width-for-height layout. Read more
Source§

fn scale_factor(&self) -> i32

Retrieves the internal scale factor that maps from window coordinates to the actual device pixels. On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2). Read more
Source§

fn screen(&self) -> Option<Screen>

Get the gdk::Screen from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top. Read more
Source§

fn get_sensitive(&self) -> bool

Returns the widget’s sensitivity (in the sense of returning the value that has been set using set_sensitive()). Read more
Source§

fn settings(&self) -> Option<Settings>

Gets the settings object holding the settings used for this widget. Read more
Source§

fn size_request(&self) -> (i32, i32)

Gets the size request that was explicitly set for the widget using set_size_request(). A value of -1 stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used instead. See set_size_request(). To get the size a widget will actually request, call preferred_size() instead of this function. Read more
Source§

fn state_flags(&self) -> StateFlags

Returns the widget state as a flag set. It is worth mentioning that the effective StateFlags::INSENSITIVE state will be returned, that is, also based on parent insensitivity, even if self itself is sensitive. Read more
Source§

fn style_context(&self) -> StyleContext

Returns the style context associated to self. The returned object is guaranteed to be the same for the lifetime of self. Read more
Source§

fn supports_multidevice(&self) -> bool

Returns true if self is multiple pointer aware. See set_support_multidevice() for more information. Read more
Source§

fn template_child(&self, widget_type: Type, name: &str) -> Option<Object>

Fetch an object build from the template XML for widget_type in this self instance. Read more
Source§

fn tooltip_markup(&self) -> Option<GString>

Gets the contents of the tooltip for self. Read more
Source§

fn tooltip_text(&self) -> Option<GString>

Gets the contents of the tooltip for self. Read more
Source§

fn tooltip_window(&self) -> Option<Window>

Returns the Window of the current tooltip. This can be the GtkWindow created by default, or the custom tooltip window set using set_tooltip_window(). Read more
Source§

fn toplevel(&self) -> Option<Widget>

This function returns the topmost widget in the container hierarchy self is a part of. If self has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced. Read more
Source§

fn valign(&self) -> Align

Gets the value of the valign property. Read more
Source§

fn valign_with_baseline(&self) -> Align

Gets the value of the valign property, including Align::Baseline. Read more
Source§

fn vexpands(&self) -> bool

Gets whether the widget would like any available extra vertical space. Read more
Source§

fn is_vexpand_set(&self) -> bool

Gets whether set_vexpand() has been used to explicitly set the expand flag on this widget. Read more
Source§

fn get_visible(&self) -> bool

Determines whether the widget is visible. If you want to take into account whether the widget’s parent is also marked as visible, use is_visible() instead. Read more
Source§

fn visual(&self) -> Option<Visual>

Gets the visual that will be used to render self. Read more
Source§

fn window(&self) -> Option<Window>

Returns the widget’s window if it is realized, None otherwise Read more
Source§

fn grab_add(&self)

Makes self the current grabbed widget. Read more
Source§

fn grab_default(&self)

Causes self to become the default widget. self must be able to be a default widget; typically you would ensure this yourself by calling set_can_default() with a true value. The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, activate() should affect them. Note that Entry widgets require the “activates-default” property set to true before they activate the default widget when Enter is pressed and the Entry is focused.
Source§

fn grab_focus(&self)

Causes self to have the keyboard focus for the Window it’s inside. self must be a focusable widget, such as a Entry; something like Frame won’t work. Read more
Source§

fn grab_remove(&self)

Removes the grab from the given widget. Read more
Source§

fn has_default(&self) -> bool

Determines whether self is the current default widget within its toplevel. See set_can_default(). Read more
Source§

fn has_focus(&self) -> bool

Determines if the widget has the global input focus. See is_focus() for the difference between having the global input focus, and only having the focus within a toplevel. Read more
Source§

fn has_grab(&self) -> bool

Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse). Read more
Source§

fn has_screen(&self) -> bool

Checks whether there is a gdk::Screen is associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a hierarchy with a toplevel window at the top. Read more
Source§

fn has_visible_focus(&self) -> bool

Determines if the widget should show a visible indication that it has the global input focus. This is a convenience function for use in ::draw handlers that takes into account whether focus indication should currently be shown in the toplevel window of self. See GtkWindowExt::gets_focus_visible() for more information about focus indication. Read more
Source§

fn hide(&self)

Reverses the effects of show(), causing the widget to be hidden (invisible to the user).
Source§

fn in_destruction(&self) -> bool

Returns whether the widget is currently being destroyed. This information can sometimes be used to avoid doing unnecessary work. Read more
Source§

fn init_template(&self)

Creates and initializes child widgets defined in templates. This function must be called in the instance initializer for any class which assigned itself a template using gtk_widget_class_set_template() Read more
Source§

fn input_shape_combine_region(&self, region: Option<&Region>)

Sets an input shape for this widget’s GDK window. This allows for windows which react to mouse click in a nonrectangular region, see Window::input_shape_combine_region() for more information. Read more
Source§

fn insert_action_group(&self, name: &str, group: Option<&impl IsA<ActionGroup>>)

Inserts group into self. Children of self that implement Actionable can then be associated with actions in group by setting their “action-name” to prefix.action-name. Read more
Source§

fn is_ancestor(&self, ancestor: &impl IsA<Widget>) -> bool

Determines whether self is somewhere inside ancestor, possibly with intermediate containers. Read more
Source§

fn is_drawable(&self) -> bool

Determines whether self can be drawn to. A widget can be drawn to if it is mapped and visible. Read more
Source§

fn is_focus(&self) -> bool

Determines if the widget is the focus widget within its toplevel. (This does not mean that the has-focus property is necessarily set; has-focus will only be set if the toplevel widget additionally has the global input focus.) Read more
Source§

fn is_sensitive(&self) -> bool

Returns the widget’s effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive Read more
Source§

fn is_toplevel(&self) -> bool

Determines whether self is a toplevel widget. Read more
Source§

fn is_visible(&self) -> bool

Determines whether the widget and all its parents are marked as visible. Read more
Source§

fn keynav_failed(&self, direction: DirectionType) -> bool

This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the keynav-failed signal on the widget and its return value should be interpreted in a way similar to the return value of child_focus(): Read more
Source§

fn list_accel_closures(&self) -> Vec<Closure>

Lists the closures used by self for accelerator group connections with AccelGroupExtManual::connect_accel_group_by_path() or AccelGroupExtManual::connect_accel_group(). The closures can be used to monitor accelerator changes on self, by connecting to the AccelGroup signal of the AccelGroup of a closure which can be found out with AccelGroup::from_accel_closure(). Read more
Source§

fn list_action_prefixes(&self) -> Vec<GString>

Retrieves a None-terminated array of strings containing the prefixes of gio::ActionGroup’s available to self. Read more
Source§

fn list_mnemonic_labels(&self) -> Vec<Widget>

Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, LabelExt::set_mnemonic_widget()). Read more
Source§

fn map(&self)

This function is only for use in widget implementations. Causes a widget to be mapped if it isn’t already.
Source§

fn mnemonic_activate(&self, group_cycling: bool) -> bool

Emits the mnemonic-activate signal. Read more
Source§

fn queue_allocate(&self)

This function is only for use in widget implementations. Read more
Source§

fn queue_compute_expand(&self)

Mark self as needing to recompute its expand flags. Call this function when setting legacy expand child properties on the child of a container. Read more
Source§

fn queue_draw(&self)

Equivalent to calling queue_draw_area() for the entire area of a widget.
Source§

fn queue_draw_area(&self, x: i32, y: i32, width: i32, height: i32)

Convenience function that calls queue_draw_region() on the region created from the given coordinates. Read more
Source§

fn queue_draw_region(&self, region: &Region)

Invalidates the area of self defined by region by calling Window::invalidate_region() on the widget’s window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated. Read more
Source§

fn queue_resize(&self)

This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a Label, Label queues a resize to ensure there’s enough space for the new text. Read more
Source§

fn queue_resize_no_redraw(&self)

This function works like queue_resize(), except that the widget is not invalidated.
Source§

fn realize(&self)

Creates the GDK (windowing system) resources associated with a widget. For example, self->window will be created when a widget is realized. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically. Read more
Source§

fn register_window(&self, window: &Window)

Registers a gdk::Window with the widget and sets it up so that the widget receives events for it. Call unregister_window() when destroying the window. Read more
Source§

fn remove_accelerator( &self, accel_group: &impl IsA<AccelGroup>, accel_key: u32, accel_mods: ModifierType, ) -> bool

Removes an accelerator from self, previously installed with add_accelerator(). Read more
Source§

fn remove_mnemonic_label(&self, label: &impl IsA<Widget>)

Removes a widget from the list of mnemonic labels for this widget. (See list_mnemonic_labels()). The widget must have previously been added to the list with add_mnemonic_label(). Read more
Source§

fn reset_style(&self)

Updates the style context of self and all descendants by updating its widget path. GtkContainers may want to use this on a child when reordering it in a way that a different style might apply to it. See also ContainerExt::path_for_child().
Source§

fn send_focus_change(&self, event: &Event) -> bool

Sends the focus change event to self Read more
Source§

fn set_accel_path( &self, accel_path: Option<&str>, accel_group: Option<&impl IsA<AccelGroup>>, )

Given an accelerator group, accel_group, and an accelerator path, accel_path, sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, self will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to set_accel_path(). Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See gtk_accel_map_save().) Read more
Source§

fn set_allocation(&self, allocation: &Allocation)

Sets the widget’s allocation. This should not be used directly, but from within a widget’s size_allocate method. Read more
Source§

fn set_app_paintable(&self, app_paintable: bool)

Sets whether the application intends to draw on the widget in an draw handler. Read more
Source§

fn set_can_default(&self, can_default: bool)

Specifies whether self can be a default widget. See grab_default() for details about the meaning of “default”. Read more
Source§

fn set_can_focus(&self, can_focus: bool)

Specifies whether self can own the input focus. See grab_focus() for actually setting the input focus on a widget. Read more
Source§

fn set_child_visible(&self, is_visible: bool)

Sets whether self should be mapped along with its when its parent is mapped and self has been shown with show(). Read more
Source§

fn set_clip(&self, clip: &Allocation)

Sets the widget’s clip. This must not be used directly, but from within a widget’s size_allocate method. It must be called after set_allocation() (or after chaining up to the parent class), because that function resets the clip. Read more
Source§

fn set_device_enabled(&self, device: &Device, enabled: bool)

Enables or disables a gdk::Device to interact with self and all its children. Read more
Source§

fn set_device_events(&self, device: &Device, events: EventMask)

Sets the device event mask (see gdk::EventMask) for a widget. The event mask determines which events a widget will receive from device. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Consider add_device_events() for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with windowless widgets (which return false from has_window()); to get events on those widgets, place them inside a EventBox and receive events on the event box. Read more
Source§

fn set_direction(&self, dir: TextDirection)

Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification). Read more
Source§

fn set_focus_on_click(&self, focus_on_click: bool)

Sets whether the widget should grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application. Read more
Source§

fn set_font_map(&self, font_map: Option<&impl IsA<FontMap>>)

Sets the font map to use for Pango rendering. When not set, the widget will inherit the font map from its parent. Read more
Source§

fn set_font_options(&self, options: Option<&FontOptions>)

Sets the cairo::FontOptions used for Pango rendering in this widget. When not set, the default font options for the gdk::Screen will be used. Read more
Source§

fn set_halign(&self, align: Align)

Sets the horizontal alignment of self. See the halign property. Read more
Source§

fn set_has_tooltip(&self, has_tooltip: bool)

Sets the has-tooltip property on self to has_tooltip. See has-tooltip for more information. Read more
Source§

fn set_has_window(&self, has_window: bool)

Specifies whether self has a gdk::Window of its own. Note that all realized widgets have a non-None “window” pointer (window() never returns a None window when a widget is realized), but for many of them it’s actually the gdk::Window of one of its parent widgets. Widgets that do not create a window for themselves in realize must announce this by calling this function with has_window = false. Read more
Source§

fn set_hexpand(&self, expand: bool)

Sets whether the widget would like any available extra horizontal space. When a user resizes a Window, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand. Read more
Source§

fn set_hexpand_set(&self, set: bool)

Sets whether the hexpand flag (see hexpands()) will be used. Read more
Source§

fn set_mapped(&self, mapped: bool)

Marks the widget as being mapped. Read more
Source§

fn set_margin_bottom(&self, margin: i32)

Sets the bottom margin of self. See the margin-bottom property. Read more
Source§

fn set_margin_end(&self, margin: i32)

Sets the end margin of self. See the margin-end property. Read more
Source§

fn set_margin_start(&self, margin: i32)

Sets the start margin of self. See the margin-start property. Read more
Source§

fn set_margin_top(&self, margin: i32)

Sets the top margin of self. See the margin-top property. Read more
Source§

fn set_widget_name(&self, name: &str)

Widgets can be named, which allows you to refer to them from a CSS file. You can apply a style to widgets with a particular name in the CSS file. See the documentation for the CSS syntax (on the same page as the docs for StyleContext). Read more
Source§

fn set_no_show_all(&self, no_show_all: bool)

Sets the no-show-all property, which determines whether calls to show_all() will affect this widget. Read more
Source§

fn set_opacity(&self, opacity: f64)

Request the self to be rendered partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Opacity values are clamped to the [0,1] range.). This works on both toplevel widget, and child widgets, although there are some limitations: Read more
Source§

fn set_parent(&self, parent: &impl IsA<Widget>)

This function is useful only when implementing subclasses of Container. Sets the container as the parent of self, and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function is unparent(). Read more
Source§

fn set_parent_window(&self, parent_window: &Window)

Sets a non default parent window for self. Read more
Source§

fn set_realized(&self, realized: bool)

Marks the widget as being realized. This function must only be called after all GdkWindows for the self have been created and registered. Read more
Source§

fn set_receives_default(&self, receives_default: bool)

Specifies whether self will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default. Read more
Source§

fn set_redraw_on_allocate(&self, redraw_on_allocate: bool)

Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is true and the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting off will improve performance. Read more
Source§

fn set_sensitive(&self, sensitive: bool)

Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are “grayed out” and the user can’t interact with them. Insensitive widgets are known as “inactive”, “disabled”, or “ghosted” in some other toolkits. Read more
Source§

fn set_size_request(&self, width: i32, height: i32)

Sets the minimum size of a widget; that is, the widget’s size request will be at least width by height. You can use this function to force a widget to be larger than it normally would be. Read more
Source§

fn set_state_flags(&self, flags: StateFlags, clear: bool)

This function is for use in widget implementations. Turns on flag values in the current widget state (insensitive, prelighted, etc.). Read more
Source§

fn set_support_multidevice(&self, support_multidevice: bool)

Enables or disables multiple pointer awareness. If this setting is true, self will start receiving multiple, per device enter/leave events. Note that if custom GdkWindows are created in realize, Window::set_support_multidevice() will have to be called manually on them. Read more
Source§

fn set_tooltip_markup(&self, markup: Option<&str>)

Sets markup as the contents of the tooltip, which is marked up with the [Pango text markup language][PangoMarkupFormat]. Read more
Source§

fn set_tooltip_text(&self, text: Option<&str>)

Sets text as the contents of the tooltip. This function will take care of setting has-tooltip to true and of the default handler for the query-tooltip signal. Read more
Source§

fn set_tooltip_window(&self, custom_window: Option<&impl IsA<Window>>)

Replaces the default window used for displaying tooltips with custom_window. GTK+ will take care of showing and hiding custom_window at the right moment, to behave likewise as the default tooltip window. If custom_window is None, the default tooltip window will be used. Read more
Source§

fn set_valign(&self, align: Align)

Sets the vertical alignment of self. See the valign property. Read more
Source§

fn set_vexpand(&self, expand: bool)

Sets whether the widget would like any available extra vertical space. Read more
Source§

fn set_vexpand_set(&self, set: bool)

Sets whether the vexpand flag (see vexpands()) will be used. Read more
Source§

fn set_visible(&self, visible: bool)

Sets the visibility state of self. Note that setting this to true doesn’t mean the widget is actually viewable, see get_visible(). Read more
Source§

fn set_visual(&self, visual: Option<&Visual>)

Sets the visual that should be used for by widget and its children for creating GdkWindows. The visual must be on the same gdk::Screen as returned by screen(), so handling the screen-changed signal is necessary. Read more
Source§

fn set_window(&self, window: Window)

Sets a widget’s window. This function should only be used in a widget’s realize implementation. The window passed is usually either new window created with gdk::Window::new(), or the window of its parent widget as returned by parent_window(). Read more
Source§

fn shape_combine_region(&self, region: Option<&Region>)

Sets a shape for this widget’s GDK window. This allows for transparent windows etc., see Window::shape_combine_region() for more information. Read more
Source§

fn show(&self)

Flags a widget to be displayed. Any widget that isn’t shown will not appear on the screen. If you want to show all the widgets in a container, it’s easier to call show_all() on the container, instead of individually showing the widgets. Read more
Source§

fn show_all(&self)

Recursively shows a widget, and any child widgets (if the widget is a container).
Source§

fn show_now(&self)

Shows a widget. If the widget is an unmapped toplevel widget (i.e. a Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.
Source§

fn size_allocate(&self, allocation: &Allocation)

This function is only used by Container subclasses, to assign a size and position to their child widgets. Read more
Source§

fn size_allocate_with_baseline( &self, allocation: &mut Allocation, baseline: i32, )

This function is only used by Container subclasses, to assign a size, position and (optionally) baseline to their child widgets. Read more
Source§

fn style_get_property(&self, property_name: &str) -> Value

Gets the value of a style property of self. Read more
Source§

fn thaw_child_notify(&self)

Reverts the effect of a previous call to freeze_child_notify(). This causes all queued child-notify signals on self to be emitted.
Source§

fn translate_coordinates( &self, dest_widget: &impl IsA<Widget>, src_x: i32, src_y: i32, ) -> Option<(i32, i32)>

Translate coordinates relative to self’s allocation to coordinates relative to dest_widget’s allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel. Read more
Source§

fn trigger_tooltip_query(&self)

Triggers a tooltip query on the display where the toplevel of self is located. See Tooltip::trigger_tooltip_query() for more information.
Source§

fn unmap(&self)

This function is only for use in widget implementations. Causes a widget to be unmapped if it’s currently mapped.
Source§

fn unparent(&self)

This function is only for use in widget implementations. Should be called by implementations of the remove method on Container, to dissociate a child from the container.
Source§

fn unrealize(&self)

This function is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as self->window).
Source§

fn unregister_window(&self, window: &Window)

Unregisters a gdk::Window from the widget that was previously set up with register_window(). You need to call this when the window is no longer used by the widget, such as when you destroy it. Read more
Source§

fn unset_state_flags(&self, flags: StateFlags)

This function is for use in widget implementations. Turns off flag values for the current widget state (insensitive, prelighted, etc.). See set_state_flags(). Read more
Source§

fn is_composite_child(&self) -> bool

Source§

fn expands(&self) -> bool

Whether to expand in both directions. Setting this sets both hexpand and vexpand
Source§

fn set_expand(&self, expand: bool)

Whether to expand in both directions. Setting this sets both hexpand and vexpand
Source§

fn set_has_default(&self, has_default: bool)

Source§

fn set_has_focus(&self, has_focus: bool)

Source§

fn height_request(&self) -> i32

Source§

fn set_height_request(&self, height_request: i32)

Source§

fn set_is_focus(&self, is_focus: bool)

Source§

fn margin(&self) -> i32

Sets all four sides’ margin at once. If read, returns max margin on any side.
Source§

fn set_margin(&self, margin: i32)

Sets all four sides’ margin at once. If read, returns max margin on any side.
Source§

fn width_request(&self) -> i32

Source§

fn set_width_request(&self, width_request: i32)

Source§

fn connect_accel_closures_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_button_press_event<F: Fn(&Self, &EventButton) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::button-press-event signal will be emitted when a button (typically from a mouse) is pressed. Read more
Source§

fn connect_button_release_event<F: Fn(&Self, &EventButton) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::button-release-event signal will be emitted when a button (typically from a mouse) is released. Read more
Source§

fn connect_can_activate_accel<F: Fn(&Self, u32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This signal is present to allow applications and derived widgets to override the default Widget handling for determining whether an accelerator can be activated. Read more
Source§

fn connect_child_notify<F: Fn(&Self, &ParamSpec) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId

The ::child-notify signal is emitted for each [child property][child-properties] that has changed on an object. The signal’s detail holds the property name. Read more
Source§

fn connect_configure_event<F: Fn(&Self, &EventConfigure) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::configure-event signal will be emitted when the size, position or stacking of the widget’s window has changed. Read more
Source§

fn connect_damage_event<F: Fn(&Self, &EventExpose) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when a redirected window belonging to widget gets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into. Read more
Source§

fn connect_delete_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::delete-event signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Connecting WidgetExtManual::hide_on_delete() to this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it. Read more
Source§

fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Signals that all holders of a reference to the widget should release the reference that they hold. May result in finalization of the widget if all references are released. Read more
Source§

fn connect_destroy_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::destroy-event signal is emitted when a gdk::Window is destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time. Read more
Source§

fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::direction-changed signal is emitted when the text direction of a widget changes. Read more
Source§

fn connect_drag_begin<F: Fn(&Self, &DragContext) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-begin signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with e.g. drag_source_set_icon_pixbuf(). Read more
Source§

fn connect_drag_data_delete<F: Fn(&Self, &DragContext) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-data-delete signal is emitted on the drag source when a drag with the action gdk::DragAction::MOVE is successfully completed. The signal handler is responsible for deleting the data that has been dropped. What “delete” means depends on the context of the drag operation. Read more
Source§

fn connect_drag_data_get<F: Fn(&Self, &DragContext, &SelectionData, u32, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-data-get signal is emitted on the drag source when the drop site requests the data which is dragged. It is the responsibility of the signal handler to fill data with the data in the format which is indicated by info. See SelectionData::set() and SelectionData::set_text(). Read more
Source§

fn connect_drag_data_received<F: Fn(&Self, &DragContext, i32, i32, &SelectionData, u32, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-data-received signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call gdk_drag_status() and not finish the drag. If the data was received in response to a drag-drop signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call gtk_drag_finish(), setting the success parameter depending on whether the data was processed successfully. Read more
Source§

fn connect_drag_drop<F: Fn(&Self, &DragContext, i32, i32, u32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-drop signal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler must ensure that gtk_drag_finish() is called to let the source know that the drop is done. The call to gtk_drag_finish() can be done either directly or in a drag-data-received handler which gets triggered by calling drag_get_data() to receive the data for one or more of the supported targets. Read more
Source§

fn connect_drag_end<F: Fn(&Self, &DragContext) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-end signal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in drag-begin. Read more
Source§

fn connect_drag_failed<F: Fn(&Self, &DragContext, DragResult) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-failed signal is emitted on the drag source when a drag has failed. The signal handler may hook custom code to handle a failed DnD operation based on the type of error, it returns true is the failure has been already handled (not showing the default “drag operation failed” animation), otherwise it returns false. Read more
Source§

fn connect_drag_leave<F: Fn(&Self, &DragContext, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-leave signal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done in drag-motion, e.g. undo highlighting with drag_unhighlight(). Read more
Source§

fn connect_drag_motion<F: Fn(&Self, &DragContext, i32, i32, u32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drag-motion signal is emitted on the drop site when the user moves the cursor over the widget during a drag. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by calling gdk_drag_status(). Read more
Source§

fn connect_draw<F: Fn(&Self, &Context) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when a widget is supposed to render itself. The widget’s top left corner must be painted at the origin of the passed in context and be sized to the values returned by allocated_width() and allocated_height(). Read more
Source§

fn connect_enter_notify_event<F: Fn(&Self, &EventCrossing) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::enter-notify-event will be emitted when the pointer enters the widget’s window. Read more
Source§

fn connect_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The GTK+ main loop will emit three signals for each GDK event delivered to a widget: one generic ::event signal, another, more specific, signal that matches the type of event delivered (e.g. key-press-event) and finally a generic event-after signal. Read more
Source§

fn connect_event_after<F: Fn(&Self, &Event) + 'static>( &self, f: F, ) -> SignalHandlerId

After the emission of the event signal and (optionally) the second more specific signal, ::event-after will be emitted regardless of the previous two signals handlers return values. Read more
Source§

fn connect_focus<F: Fn(&Self, DirectionType) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

Returns Read more
Source§

fn connect_focus_in_event<F: Fn(&Self, &EventFocus) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::focus-in-event signal will be emitted when the keyboard focus enters the widget’s window. Read more
Source§

fn connect_focus_out_event<F: Fn(&Self, &EventFocus) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::focus-out-event signal will be emitted when the keyboard focus leaves the widget’s window. Read more
Source§

fn connect_grab_broken_event<F: Fn(&Self, &EventGrabBroken) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when a pointer or keyboard grab on a window belonging to widget gets broken. Read more
Source§

fn connect_grab_focus<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn emit_grab_focus(&self)

Source§

fn connect_grab_notify<F: Fn(&Self, bool) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::grab-notify signal is emitted when a widget becomes shadowed by a GTK+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed. Read more
Source§

fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::hide signal is emitted when widget is hidden, for example with hide().
Source§

fn connect_hierarchy_changed<F: Fn(&Self, Option<&Widget>) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::hierarchy-changed signal is emitted when the anchored state of a widget changes. A widget is “anchored” when its toplevel ancestor is a Window. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa. Read more
Source§

fn connect_key_press_event<F: Fn(&Self, &EventKey) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::key-press-event signal is emitted when a key is pressed. The signal emission will reoccur at the key-repeat rate when the key is kept pressed. Read more
Source§

fn connect_key_release_event<F: Fn(&Self, &EventKey) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::key-release-event signal is emitted when a key is released. Read more
Source§

fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

Gets emitted if keyboard navigation fails. See keynav_failed() for details. Read more
Source§

fn connect_leave_notify_event<F: Fn(&Self, &EventCrossing) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::leave-notify-event will be emitted when the pointer leaves the widget’s window. Read more
Source§

fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::map signal is emitted when widget is going to be mapped, that is when the widget is visible (which is controlled with set_visible()) and all its parents up to the toplevel widget are also visible. Once the map has occurred, map-event will be emitted. Read more
Source§

fn connect_mnemonic_activate<F: Fn(&Self, bool) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The default handler for this signal activates widget if group_cycling is false, or just makes widget grab focus if group_cycling is true. Read more
Source§

fn connect_motion_notify_event<F: Fn(&Self, &EventMotion) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::motion-notify-event signal is emitted when the pointer moves over the widget’s gdk::Window. Read more
Source§

fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn emit_move_focus(&self, direction: DirectionType)

Source§

fn connect_parent_set<F: Fn(&Self, Option<&Widget>) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::parent-set signal is emitted when a new parent has been set on a widget. Read more
Source§

fn connect_popup_menu<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal gets emitted whenever a widget should pop up a context menu. This usually happens through the standard key binding mechanism; by pressing a certain key while a widget is focused, the user can cause the widget to pop up a menu. For example, the Entry widget creates a menu with clipboard commands. See the [Popup Menu Migration Checklist][checklist-popup-menu] for an example of how to use this signal. Read more
Source§

fn emit_popup_menu(&self) -> bool

Source§

fn connect_property_notify_event<F: Fn(&Self, &EventProperty) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::property-notify-event signal will be emitted when a property on the widget’s window has been changed or deleted. Read more
Source§

fn connect_proximity_in_event<F: Fn(&Self, &EventProximity) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROXIMITY_IN_MASK mask. Read more
Source§

fn connect_proximity_out_event<F: Fn(&Self, &EventProximity) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROXIMITY_OUT_MASK mask. Read more
Source§

fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when has-tooltip is true and the hover timeout has expired with the cursor hovering “above” widget; or emitted when widget got focus in keyboard mode. Read more
Source§

fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::realize signal is emitted when widget is associated with a gdk::Window, which means that realize() has been called or the widget has been mapped (that is, it is going to be drawn).
Source§

fn connect_screen_changed<F: Fn(&Self, Option<&Screen>) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::screen-changed signal gets emitted when the screen of a widget has changed. Read more
Source§

fn connect_scroll_event<F: Fn(&Self, &EventScroll) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::scroll-event signal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned. Read more
Source§

fn connect_selection_clear_event<F: Fn(&Self, &EventSelection) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::selection-clear-event signal will be emitted when the the widget’s window has lost ownership of a selection. Read more
Source§

fn connect_selection_get<F: Fn(&Self, &SelectionData, u32, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_selection_notify_event<F: Fn(&Self, &EventSelection) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

Returns Read more
Source§

fn connect_selection_received<F: Fn(&Self, &SelectionData, u32) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_selection_request_event<F: Fn(&Self, &EventSelection) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::selection-request-event signal will be emitted when another client requests ownership of the selection owned by the widget’s window. Read more
Source§

fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::show signal is emitted when widget is shown, for example with show().
Source§

fn connect_show_help<F: Fn(&Self, WidgetHelpType) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

Returns Read more
Source§

fn emit_show_help(&self, help_type: WidgetHelpType) -> bool

Source§

fn connect_size_allocate<F: Fn(&Self, &Allocation) + 'static>( &self, f: F, ) -> SignalHandlerId

allocation Read more
Source§

fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::state-flags-changed signal is emitted when the widget state changes, see state_flags(). Read more
Source§

fn connect_style_updated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::style-updated signal is a convenience signal that is emitted when the changed signal is emitted on the widget’s associated StyleContext as returned by style_context(). Read more
Source§

fn connect_touch_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::unmap signal is emitted when widget is going to be unmapped, which means that either it or any of its parents up to the toplevel widget have been set as hidden. Read more
Source§

fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

The ::unrealize signal is emitted when the gdk::Window associated with widget is destroyed, which means that unrealize() has been called or the widget has been unmapped (that is, it is going to be hidden).
Source§

fn connect_window_state_event<F: Fn(&Self, &EventWindowState) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::window-state-event will be emitted when the state of the toplevel window associated to the widget changes. Read more
Source§

fn connect_app_paintable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_can_default_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_can_focus_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_composite_child_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_events_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_focus_on_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_halign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_has_default_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_has_focus_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_has_tooltip_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_height_request_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_hexpand_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_hexpand_set_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_is_focus_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_margin_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_margin_bottom_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_margin_end_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_margin_start_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_margin_top_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_no_show_all_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_opacity_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_receives_default_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_scale_factor_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_sensitive_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_tooltip_markup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_tooltip_text_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_valign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

fn connect_vexpand_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_vexpand_set_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_width_request_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source§

fn connect_window_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source§

impl<O> WidgetExtManual for O
where O: IsA<Widget>,

Source§

fn drag_dest_set( &self, flags: DestDefaults, targets: &[TargetEntry], actions: DragAction, )

Sets a widget as a potential drop destination, and adds default behaviors. Read more
Source§

fn drag_source_set( &self, start_button_mask: ModifierType, targets: &[TargetEntry], actions: DragAction, )

Sets up a widget so that GTK+ will start a drag operation when the user clicks and drags on the widget. The widget must have a window. Read more
Source§

fn intersect( &self, area: &Rectangle, intersection: Option<&mut Rectangle>, ) -> bool

Computes the intersection of a self’s area and area, storing the intersection in intersection, and returns true if there was an intersection. intersection may be None if you’re only interested in whether there was an intersection. Read more
Source§

fn connect_map_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::map-event signal will be emitted when the widget’s window is mapped. A window is mapped when it becomes visible on the screen. Read more
Source§

fn connect_unmap_event<F: Fn(&Self, &Event) -> Propagation + 'static>( &self, f: F, ) -> SignalHandlerId

The ::unmap-event signal will be emitted when the widget’s window is unmapped. A window is unmapped when it becomes invisible on the screen. Read more
Source§

fn add_tick_callback<P: Fn(&Self, &FrameClock) -> ControlFlow + 'static>( &self, callback: P, ) -> TickCallbackId

Queues an animation frame update and adds a callback to be called before each frame. Until the tick callback is removed, it will be called frequently (usually at the frame rate of the output device or as quickly as the application can be repainted, whichever is slower). For this reason, is most suitable for handling graphics that change every frame or every few frames. The tick callback does not automatically imply a relayout or repaint. If you want a repaint or relayout, and aren’t changing widget properties that would trigger that (for example, changing the text of a Label), then you will have to call WidgetExt::queue_resize() or WidgetExt::queue_draw_area() yourself. Read more
Source§

fn add_events(&self, events: EventMask)

Adds the events in the bitfield events to the event mask for self. See WidgetExtManual::set_events() and the [input handling overview][event-masks] for details. Read more
Source§

fn events(&self) -> EventMask

Returns the event mask (see gdk::EventMask) for the widget. These are the events that the widget will receive. Read more
Source§

fn set_events(&self, events: EventMask)

Sets the event mask (see gdk::EventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Consider WidgetExtManual::add_events() for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with widgets that have no window. (See WidgetExt::has_window()). To get events on those widgets, place them inside a EventBox and receive events on the event box. Read more
Source§

unsafe fn destroy(&self)

Calls gtk_widget_destroy() on this widget. Read more
Source§

fn hide_on_delete(&self) -> Propagation

Utility function; intended to be connected to the delete-event signal on a Window. The function calls WidgetExt::hide() on its argument, then returns true. If connected to ::delete-event, the result is that clicking the close button for a window (on the window frame, top right corner usually) will hide but not destroy the window. By default, GTK+ destroys windows when ::delete-event is received. Read more