Skip to main content

FileChooserDialog

Struct FileChooserDialog 

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

FileChooserDialog is a dialog box suitable for use with “File/Open” or “File/Save as” commands. This widget works by putting a FileChooserWidget inside a Dialog. It exposes the FileChooser interface, so you can use all of the FileChooser functions on the file chooser dialog as well as those for Dialog.

Note that FileChooserDialog does not have any methods of its own. Instead, you should use the functions that work on a FileChooser.

If you want to integrate well with the platform you should use the FileChooserNative API, which will use a platform-specific dialog if available and fall back to GtkFileChooserDialog otherwise.

§Typical usage ## {gtkfilechooser-typical-usage}

In the simplest of cases, you can the following code to use FileChooserDialog to select a file for opening:

GtkWidget *dialog;
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
gint res;

dialog = gtk_file_chooser_dialog_new ("Open File",
                                      parent_window,
                                      action,
                                      _("_Cancel"),
                                      GTK_RESPONSE_CANCEL,
                                      _("_Open"),
                                      GTK_RESPONSE_ACCEPT,
                                      NULL);

res = gtk_dialog_run (GTK_DIALOG (dialog));
if (res == GTK_RESPONSE_ACCEPT)
  {
    char *filename;
    GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog);
    filename = gtk_file_chooser_get_filename (chooser);
    open_file (filename);
    g_free (filename);
  }

gtk_widget_destroy (dialog);

To use a dialog for saving, you can use this:

GtkWidget *dialog;
GtkFileChooser *chooser;
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE;
gint res;

dialog = gtk_file_chooser_dialog_new ("Save File",
                                      parent_window,
                                      action,
                                      _("_Cancel"),
                                      GTK_RESPONSE_CANCEL,
                                      _("_Save"),
                                      GTK_RESPONSE_ACCEPT,
                                      NULL);
chooser = GTK_FILE_CHOOSER (dialog);

gtk_file_chooser_set_do_overwrite_confirmation (chooser, TRUE);

if (user_edited_a_new_document)
  gtk_file_chooser_set_current_name (chooser,
                                     _("Untitled document"));
else
  gtk_file_chooser_set_filename (chooser,
                                 existing_filename);

res = gtk_dialog_run (GTK_DIALOG (dialog));
if (res == GTK_RESPONSE_ACCEPT)
  {
    char *filename;

    filename = gtk_file_chooser_get_filename (chooser);
    save_to_file (filename);
    g_free (filename);
  }

gtk_widget_destroy (dialog);

§Setting up a file chooser dialog ## {gtkfilechooserdialog-setting-up}

There are various cases in which you may need to use a FileChooserDialog:

Note that old versions of the file chooser’s documentation suggested using FileChooserExt::set_current_folder() in various situations, with the intention of letting the application suggest a reasonable default folder. This is no longer considered to be a good policy, as now the file chooser is able to make good suggestions on its own. In general, you should only cause the file chooser to show a specific folder when it is appropriate to use FileChooserExt::set_filename(), i.e. when you are doing a Save As command and you already have a file saved somewhere.

§Response Codes ## {gtkfilechooserdialog-responses}

FileChooserDialog inherits from Dialog, so buttons that go in its action area have response codes such as ResponseType::Accept and ResponseType::Cancel. For example, you could call gtk_file_chooser_dialog_new() as follows:

GtkWidget *dialog;
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;

dialog = gtk_file_chooser_dialog_new ("Open File",
                                      parent_window,
                                      action,
                                      _("_Cancel"),
                                      GTK_RESPONSE_CANCEL,
                                      _("_Open"),
                                      GTK_RESPONSE_ACCEPT,
                                      NULL);

This will create buttons for “Cancel” and “Open” that use stock response identifiers from ResponseType. For most dialog boxes you can use your own custom response codes rather than the ones in ResponseType, but FileChooserDialog assumes that its “accept”-type action, e.g. an “Open” or “Save” button, will have one of the following response codes:

This is because FileChooserDialog must intercept responses and switch to folders if appropriate, rather than letting the dialog terminate — the implementation uses these known response codes to know which responses can be blocked if appropriate.

To summarize, make sure you use a [stock response code][gtkfilechooserdialog-responses] when you use FileChooserDialog to ensure proper operation.

§Implements

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

Implementations§

Source§

impl FileChooserDialog

Source

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

Source

pub fn builder() -> FileChooserDialogBuilder

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

This method returns an instance of FileChooserDialogBuilder which can be used to create FileChooserDialog objects.

Source§

impl FileChooserDialog

Source

pub fn new<T: IsA<Window>>( title: Option<&str>, parent: Option<&T>, action: FileChooserAction, ) -> FileChooserDialog

Creates a new FileChooserDialog. This function is analogous to gtk_dialog_new_with_buttons().

§title

Title of the dialog, or None

§parent

Transient parent of the dialog, or None

§action

Open or save mode for the dialog

§first_button_text

stock ID or text to go in the first button, or None

§Returns

a new FileChooserDialog

Source

pub fn with_buttons<T: IsA<Window>>( title: Option<&str>, parent: Option<&T>, action: FileChooserAction, buttons: &[(&str, ResponseType)], ) -> FileChooserDialog

Trait Implementations§

Source§

impl Clone for FileChooserDialog

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 FileChooserDialog

Source§

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

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

impl Default for FileChooserDialog

Source§

fn default() -> Self

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

impl Display for FileChooserDialog

Source§

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

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

impl Eq for FileChooserDialog

Source§

impl HasParamSpec for FileChooserDialog

Source§

type ParamSpec = ParamSpecObject

Source§

type SetValue = FileChooserDialog

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

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

Source§

fn param_spec_builder() -> Self::BuilderFn

Source§

impl Hash for FileChooserDialog

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 FileChooserDialog

Source§

impl IsA<Buildable> for FileChooserDialog

Source§

impl IsA<Container> for FileChooserDialog

Source§

impl IsA<Dialog> for FileChooserDialog

Source§

impl IsA<FileChooser> for FileChooserDialog

Source§

impl IsA<Widget> for FileChooserDialog

Source§

impl IsA<Window> for FileChooserDialog

Source§

impl Ord for FileChooserDialog

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 FileChooserDialog

Source§

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

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 FileChooserDialog

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 FileChooserDialog

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<O> FileChooserExt for O
where O: IsA<FileChooser>,

Source§

fn add_filter(&self, filter: FileFilter)

Adds filter to the list of filters that the user can select between. When a filter is selected, only files that are passed by that filter are displayed. Read more
Source§

fn add_shortcut_folder(&self, folder: impl AsRef<Path>) -> Result<(), Error>

Adds a folder to be displayed with the shortcut folders in a file chooser. Note that shortcut folders do not get saved, as they are provided by the application. For example, you can use this to add a “/usr/share/mydrawprogram/Clipart” folder to the volume list. Read more
Source§

fn add_shortcut_folder_uri(&self, uri: &str) -> Result<(), Error>

Adds a folder URI to be displayed with the shortcut folders in a file chooser. Note that shortcut folders do not get saved, as they are provided by the application. For example, you can use this to add a “file:///usr/share/mydrawprogram/Clipart” folder to the volume list. Read more
Source§

fn action(&self) -> FileChooserAction

Gets the type of operation that the file chooser is performing; see set_action(). Read more
Source§

fn choice(&self, id: &str) -> Option<GString>

Gets the currently selected option in the ‘choice’ with the given ID. Read more
Source§

fn creates_folders(&self) -> bool

Gets whether file choser will offer to create new folders. See set_create_folders(). Read more
Source§

fn current_folder(&self) -> Option<PathBuf>

Gets the current folder of self as a local filename. See set_current_folder(). Read more
Source§

fn current_folder_file(&self) -> Option<File>

Gets the current folder of self as gio::File. See current_folder_uri(). Read more
Source§

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

Gets the current folder of self as an URI. See set_current_folder_uri(). Read more
Source§

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

Gets the current name in the file selector, as entered by the user in the text entry for “Name”. Read more
Source§

fn does_overwrite_confirmation(&self) -> bool

Queries whether a file chooser is set to confirm for overwriting when the user types a file name that already exists. Read more
Source§

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

Gets the current extra widget; see set_extra_widget(). Read more
Source§

fn file(&self) -> Option<File>

Gets the gio::File for the currently selected file in the file selector. If multiple files are selected, one of the files will be returned at random. Read more
Source§

fn filename(&self) -> Option<PathBuf>

Gets the filename for the currently selected file in the file selector. The filename is returned as an absolute path. If multiple files are selected, one of the filenames will be returned at random. Read more
Source§

fn filenames(&self) -> Vec<PathBuf>

Lists all the selected files and subfolders in the current folder of self. The returned names are full absolute paths. If files in the current folder cannot be represented as local filenames they will be ignored. (See uris()) Read more
Source§

fn files(&self) -> Vec<File>

Lists all the selected files and subfolders in the current folder of self as gio::File. An internal function, see uris(). Read more
Source§

fn filter(&self) -> Option<FileFilter>

Gets the current filter; see set_filter(). Read more
Source§

fn is_local_only(&self) -> bool

Gets whether only local files can be selected in the file selector. See set_local_only() Read more
Source§

fn preview_file(&self) -> Option<File>

Gets the gio::File that should be previewed in a custom preview Internal function, see preview_uri(). Read more
Source§

fn preview_filename(&self) -> Option<PathBuf>

Gets the filename that should be previewed in a custom preview widget. See set_preview_widget(). Read more
Source§

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

Gets the URI that should be previewed in a custom preview widget. See set_preview_widget(). Read more
Source§

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

Gets the current preview widget; see set_preview_widget(). Read more
Source§

fn is_preview_widget_active(&self) -> bool

Gets whether the preview widget set by set_preview_widget() should be shown for the current filename. See set_preview_widget_active(). Read more
Source§

fn selects_multiple(&self) -> bool

Gets whether multiple files can be selected in the file selector. See set_select_multiple(). Read more
Source§

fn shows_hidden(&self) -> bool

Gets whether hidden files and folders are displayed in the file selector. See set_show_hidden(). Read more
Source§

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

Gets the URI for the currently selected file in the file selector. If multiple files are selected, one of the filenames will be returned at random. Read more
Source§

fn uris(&self) -> Vec<GString>

Lists all the selected files and subfolders in the current folder of self. The returned names are full absolute URIs. Read more
Source§

fn uses_preview_label(&self) -> bool

Gets whether a stock label should be drawn with the name of the previewed file. See set_use_preview_label(). Read more
Source§

fn list_filters(&self) -> Vec<FileFilter>

Lists the current set of user-selectable filters; see add_filter(), remove_filter(). Read more
Source§

fn list_shortcut_folder_uris(&self) -> Vec<GString>

Queries the list of shortcut folders in the file chooser, as set by add_shortcut_folder_uri(). Read more
Source§

fn list_shortcut_folders(&self) -> Vec<PathBuf>

Queries the list of shortcut folders in the file chooser, as set by add_shortcut_folder(). Read more
Source§

fn remove_choice(&self, id: &str)

Removes a ‘choice’ that has been added with [FileChooserExtManual::add_choice()][crate::prelude::FileChooserExtManual::add_choice()]. Read more
Source§

fn remove_filter(&self, filter: &FileFilter)

Removes filter from the list of filters that the user can select between. Read more
Source§

fn remove_shortcut_folder(&self, folder: impl AsRef<Path>) -> Result<(), Error>

Removes a folder from a file chooser’s list of shortcut folders. Read more
Source§

fn remove_shortcut_folder_uri(&self, uri: &str) -> Result<(), Error>

Removes a folder URI from a file chooser’s list of shortcut folders. Read more
Source§

fn select_all(&self)

Selects all the files in the current folder of a file chooser.
Source§

fn select_file(&self, file: &impl IsA<File>) -> Result<(), Error>

Selects the file referred to by file. An internal function. See _gtk_file_chooser_select_uri(). Read more
Source§

fn select_filename(&self, filename: impl AsRef<Path>) -> bool

Selects a filename. If the file name isn’t in the current folder of self, then the current folder of self will be changed to the folder containing filename. Read more
Source§

fn select_uri(&self, uri: &str) -> bool

Selects the file to by uri. If the URI doesn’t refer to a file in the current folder of self, then the current folder of self will be changed to the folder containing filename. Read more
Source§

fn set_action(&self, action: FileChooserAction)

Sets the type of operation that the chooser is performing; the user interface is adapted to suit the selected action. For example, an option to create a new folder might be shown if the action is FileChooserAction::Save but not if the action is FileChooserAction::Open. Read more
Source§

fn set_choice(&self, id: &str, option: &str)

Selects an option in a ‘choice’ that has been added with [FileChooserExtManual::add_choice()][crate::prelude::FileChooserExtManual::add_choice()]. For a boolean choice, the possible options are “true” and “false”. Read more
Source§

fn set_create_folders(&self, create_folders: bool)

Sets whether file choser will offer to create new folders. This is only relevant if the action is not set to be FileChooserAction::Open. Read more
Source§

fn set_current_folder(&self, filename: impl AsRef<Path>) -> bool

Sets the current folder for self from a local filename. The user will be shown the full contents of the current folder, plus user interface elements for navigating to other folders. Read more
Source§

fn set_current_folder_file(&self, file: &impl IsA<File>) -> Result<(), Error>

Sets the current folder for self from a gio::File. Internal function, see set_current_folder_uri(). Read more
Source§

fn set_current_folder_uri(&self, uri: &str) -> bool

Sets the current folder for self from an URI. The user will be shown the full contents of the current folder, plus user interface elements for navigating to other folders. Read more
Source§

fn set_current_name(&self, name: &str)

Sets the current name in the file selector, as if entered by the user. Note that the name passed in here is a UTF-8 string rather than a filename. This function is meant for such uses as a suggested name in a “Save As…” dialog. You can pass “Untitled.doc” or a similarly suitable suggestion for the name. Read more
Source§

fn set_do_overwrite_confirmation(&self, do_overwrite_confirmation: bool)

Sets whether a file chooser in FileChooserAction::Save mode will present a confirmation dialog if the user types a file name that already exists. This is false by default. Read more
Source§

fn set_extra_widget(&self, extra_widget: &impl IsA<Widget>)

Sets an application-supplied widget to provide extra options to the user. Read more
Source§

fn set_file(&self, file: &impl IsA<File>) -> Result<(), Error>

Sets file as the current filename for the file chooser, by changing to the file’s parent folder and actually selecting the file in list. If the self is in FileChooserAction::Save mode, the file’s base name will also appear in the dialog’s file name entry. Read more
Source§

fn set_filename(&self, filename: impl AsRef<Path>) -> bool

Sets filename as the current filename for the file chooser, by changing to the file’s parent folder and actually selecting the file in list; all other files will be unselected. If the self is in FileChooserAction::Save mode, the file’s base name will also appear in the dialog’s file name entry. Read more
Source§

fn set_filter(&self, filter: &FileFilter)

Sets the current filter; only the files that pass the filter will be displayed. If the user-selectable list of filters is non-empty, then the filter should be one of the filters in that list. Setting the current filter when the list of filters is empty is useful if you want to restrict the displayed set of files without letting the user change it. Read more
Source§

fn set_local_only(&self, local_only: bool)

Sets whether only local files can be selected in the file selector. If local_only is true (the default), then the selected file or files are guaranteed to be accessible through the operating systems native file system and therefore the application only needs to worry about the filename functions in FileChooser, like filename(), rather than the URI functions like uri(), Read more
Source§

fn set_preview_widget(&self, preview_widget: &impl IsA<Widget>)

Sets an application-supplied widget to use to display a custom preview of the currently selected file. To implement a preview, after setting the preview widget, you connect to the update-preview signal, and call preview_filename() or preview_uri() on each change. If you can display a preview of the new file, update your widget and set the preview active using set_preview_widget_active(). Otherwise, set the preview inactive. Read more
Source§

fn set_preview_widget_active(&self, active: bool)

Sets whether the preview widget set by set_preview_widget() should be shown for the current filename. When active is set to false, the file chooser may display an internally generated preview of the current file or it may display no preview at all. See set_preview_widget() for more details. Read more
Source§

fn set_select_multiple(&self, select_multiple: bool)

Sets whether multiple files can be selected in the file selector. This is only relevant if the action is set to be FileChooserAction::Open or FileChooserAction::SelectFolder. Read more
Source§

fn set_show_hidden(&self, show_hidden: bool)

Sets whether hidden files and folders are displayed in the file selector. Read more
Source§

fn set_uri(&self, uri: &str) -> bool

Sets the file referred to by uri as the current file for the file chooser, by changing to the URI’s parent folder and actually selecting the URI in the list. If the self is FileChooserAction::Save mode, the URI’s base name will also appear in the dialog’s file name entry. Read more
Source§

fn set_use_preview_label(&self, use_label: bool)

Sets whether the file chooser should display a stock label with the name of the file that is being previewed; the default is true. Applications that want to draw the whole preview area themselves should set this to false and display the name themselves in their preview widget. Read more
Source§

fn unselect_all(&self)

Unselects all the files in the current folder of a file chooser.
Source§

fn unselect_file(&self, file: &impl IsA<File>)

Unselects the file referred to by file. If the file is not in the current directory, does not exist, or is otherwise not currently selected, does nothing. Read more
Source§

fn unselect_filename(&self, filename: impl AsRef<Path>)

Unselects a currently selected filename. If the filename is not in the current directory, does not exist, or is otherwise not currently selected, does nothing. Read more
Source§

fn unselect_uri(&self, uri: &str)

Unselects the file referred to by uri. If the file is not in the current directory, does not exist, or is otherwise not currently selected, does nothing. Read more
Source§

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

This signal gets emitted whenever it is appropriate to present a confirmation dialog when the user has selected a file name that already exists. The signal only gets emitted when the file chooser is in FileChooserAction::Save mode. Read more
Source§

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

This signal is emitted when the current folder in a FileChooser changes. This can happen due to the user performing some action that changes folders, such as selecting a bookmark or visiting a folder on the file list. It can also happen as a result of calling a function to explicitly change the current folder in a file chooser. Read more
Source§

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

This signal is emitted when the user “activates” a file in the file chooser. This can happen by double-clicking on a file in the file list, or by pressing Enter. Read more
Source§

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

This signal is emitted when there is a change in the set of selected files in a FileChooser. This can happen when the user modifies the selection with the mouse or the keyboard, or when explicitly calling functions to change the selection. Read more
Source§

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

This signal is emitted when the preview in a file chooser should be regenerated. For example, this can happen when the currently selected file changes. You should use this signal if you want your file chooser to have a preview widget. Read more
Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<O> FileChooserExtManual for O
where O: IsA<FileChooser>,

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