[][src]Trait gtk::GtkWindowExt

pub trait GtkWindowExt: 'static {
    fn activate_default(&self) -> bool;
fn activate_focus(&self) -> bool;
fn activate_key(&self, event: &EventKey) -> bool;
fn add_accel_group<P: IsA<AccelGroup>>(&self, accel_group: &P);
fn add_mnemonic<P: IsA<Widget>>(&self, keyval: u32, target: &P);
fn begin_move_drag(
        &self,
        button: i32,
        root_x: i32,
        root_y: i32,
        timestamp: u32
    );
fn begin_resize_drag(
        &self,
        edge: WindowEdge,
        button: i32,
        root_x: i32,
        root_y: i32,
        timestamp: u32
    );
fn close(&self);
fn deiconify(&self);
fn fullscreen(&self);
fn fullscreen_on_monitor(&self, screen: &Screen, monitor: i32);
fn get_accept_focus(&self) -> bool;
fn get_application(&self) -> Option<Application>;
fn get_attached_to(&self) -> Option<Widget>;
fn get_decorated(&self) -> bool;
fn get_default_size(&self) -> (i32, i32);
fn get_default_widget(&self) -> Option<Widget>;
fn get_deletable(&self) -> bool;
fn get_destroy_with_parent(&self) -> bool;
fn get_focus(&self) -> Option<Widget>;
fn get_focus_on_map(&self) -> bool;
fn get_focus_visible(&self) -> bool;
fn get_gravity(&self) -> Gravity;
fn get_group(&self) -> Option<WindowGroup>;
fn get_hide_titlebar_when_maximized(&self) -> bool;
fn get_icon(&self) -> Option<Pixbuf>;
fn get_icon_list(&self) -> Vec<Pixbuf>;
fn get_icon_name(&self) -> Option<GString>;
fn get_mnemonic_modifier(&self) -> ModifierType;
fn get_mnemonics_visible(&self) -> bool;
fn get_modal(&self) -> bool;
fn get_position(&self) -> (i32, i32);
fn get_resizable(&self) -> bool;
fn get_role(&self) -> Option<GString>;
fn get_size(&self) -> (i32, i32);
fn get_skip_pager_hint(&self) -> bool;
fn get_skip_taskbar_hint(&self) -> bool;
fn get_title(&self) -> Option<GString>;
fn get_titlebar(&self) -> Option<Widget>;
fn get_transient_for(&self) -> Option<Window>;
fn get_type_hint(&self) -> WindowTypeHint;
fn get_urgency_hint(&self) -> bool;
fn get_window_type(&self) -> WindowType;
fn has_group(&self) -> bool;
fn has_toplevel_focus(&self) -> bool;
fn iconify(&self);
fn is_active(&self) -> bool;
fn is_maximized(&self) -> bool;
fn maximize(&self);
fn mnemonic_activate(&self, keyval: u32, modifier: ModifierType) -> bool;
fn move_(&self, x: i32, y: i32);
fn parse_geometry(&self, geometry: &str) -> bool;
fn present_with_time(&self, timestamp: u32);
fn propagate_key_event(&self, event: &EventKey) -> bool;
fn remove_accel_group<P: IsA<AccelGroup>>(&self, accel_group: &P);
fn remove_mnemonic<P: IsA<Widget>>(&self, keyval: u32, target: &P);
fn resize(&self, width: i32, height: i32);
fn resize_to_geometry(&self, width: i32, height: i32);
fn set_accept_focus(&self, setting: bool);
fn set_application<P: IsA<Application>>(&self, application: Option<&P>);
fn set_attached_to<P: IsA<Widget>>(&self, attach_widget: Option<&P>);
fn set_decorated(&self, setting: bool);
fn set_default<P: IsA<Widget>>(&self, default_widget: Option<&P>);
fn set_default_geometry(&self, width: i32, height: i32);
fn set_default_size(&self, width: i32, height: i32);
fn set_deletable(&self, setting: bool);
fn set_destroy_with_parent(&self, setting: bool);
fn set_focus<P: IsA<Widget>>(&self, focus: Option<&P>);
fn set_focus_on_map(&self, setting: bool);
fn set_focus_visible(&self, setting: bool);
fn set_geometry_hints<P: IsA<Widget>>(
        &self,
        geometry_widget: Option<&P>,
        geometry: Option<&Geometry>,
        geom_mask: WindowHints
    );
fn set_gravity(&self, gravity: Gravity);
fn set_has_user_ref_count(&self, setting: bool);
fn set_hide_titlebar_when_maximized(&self, setting: bool);
fn set_icon(&self, icon: Option<&Pixbuf>);
fn set_icon_from_file<P: AsRef<Path>>(
        &self,
        filename: P
    ) -> Result<(), Error>;
fn set_icon_list(&self, list: &[Pixbuf]);
fn set_icon_name(&self, name: Option<&str>);
fn set_keep_above(&self, setting: bool);
fn set_keep_below(&self, setting: bool);
fn set_mnemonic_modifier(&self, modifier: ModifierType);
fn set_mnemonics_visible(&self, setting: bool);
fn set_modal(&self, modal: bool);
fn set_position(&self, position: WindowPosition);
fn set_resizable(&self, resizable: bool);
fn set_role(&self, role: &str);
fn set_screen(&self, screen: &Screen);
fn set_skip_pager_hint(&self, setting: bool);
fn set_skip_taskbar_hint(&self, setting: bool);
fn set_startup_id(&self, startup_id: &str);
fn set_title(&self, title: &str);
fn set_titlebar<P: IsA<Widget>>(&self, titlebar: Option<&P>);
fn set_transient_for<P: IsA<Window>>(&self, parent: Option<&P>);
fn set_type_hint(&self, hint: WindowTypeHint);
fn set_urgency_hint(&self, setting: bool);
fn set_wmclass(&self, wmclass_name: &str, wmclass_class: &str);
fn stick(&self);
fn unfullscreen(&self);
fn unmaximize(&self);
fn unstick(&self);
fn get_property_default_height(&self) -> i32;
fn set_property_default_height(&self, default_height: i32);
fn get_property_default_width(&self) -> i32;
fn set_property_default_width(&self, default_width: i32);
fn get_property_has_toplevel_focus(&self) -> bool;
fn get_property_is_active(&self) -> bool;
fn get_property_is_maximized(&self) -> bool;
fn get_property_type(&self) -> WindowType;
fn get_property_window_position(&self) -> WindowPosition;
fn set_property_window_position(&self, window_position: WindowPosition);
fn connect_activate_default<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_activate_default(&self);
fn connect_activate_focus<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_activate_focus(&self);
fn connect_enable_debugging<F: Fn(&Self, bool) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn emit_enable_debugging(&self, toggle: bool) -> bool;
fn connect_keys_changed<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_set_focus<F: Fn(&Self, &Widget) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_accept_focus_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_application_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_attached_to_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_decorated_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_default_height_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_default_width_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_deletable_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_destroy_with_parent_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_focus_on_map_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_focus_visible_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_gravity_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_has_toplevel_focus_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_hide_titlebar_when_maximized_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_icon_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_icon_name_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_is_active_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_is_maximized_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_mnemonics_visible_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_modal_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_resizable_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_role_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_screen_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_skip_pager_hint_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_skip_taskbar_hint_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_startup_id_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_title_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_transient_for_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_type_hint_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_urgency_hint_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_window_position_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all Window methods.

Implementors

ApplicationWindow, Assistant, Dialog, OffscreenWindow, Plug, ShortcutsWindow, Window

Required methods

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.

Returns

true if a widget got activated.

fn activate_focus(&self) -> bool

Activates the current focused widget within the window.

Returns

true if a widget got activated.

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.

event

a gdk::EventKey

Returns

true if a mnemonic or accelerator was found and activated.

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

Associate accel_group with self, such that calling gtk_accel_groups_activate on self will activate accelerators in accel_group.

accel_group

a AccelGroup

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

Adds a mnemonic to this window.

keyval

the mnemonic

target

the widget that gets activated by the mnemonic

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.

button

mouse button that initiated the drag

root_x

X position where the user clicked to initiate the drag, in root window coordinates

root_y

Y position where the user clicked to initiate the drag

timestamp

timestamp from the click event that initiated the drag

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.

edge

position of the resize control

button

mouse button that initiated the drag

root_x

X position where the user clicked to initiate the drag, in root window coordinates

root_y

Y position where the user clicked to initiate the drag

timestamp

timestamp from the click event that initiated the drag

fn close(&self)

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

This function can be used with close buttons in custom titlebars.

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.

You can track iconification via the “window-state-event” signal on Widget.

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.

You can track the fullscreen state via the “window-state-event” signal on Widget.

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.

You can track the fullscreen state via the "window-state-event" signal on Widget.

Feature: v3_18

screen

a gdk::Screen to draw to

monitor

which monitor to go fullscreen on

fn get_accept_focus(&self) -> bool

Gets the value set by GtkWindowExt::set_accept_focus.

Returns

true if window should receive the input focus

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

Gets the Application associated with the window (if any).

Returns

a Application, or None

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

Fetches the attach widget for this window. See GtkWindowExt::set_attached_to.

Returns

the widget where the window is attached, or None if the window is not attached to any widget.

fn get_decorated(&self) -> bool

Returns whether the window has been set to have decorations such as a title bar via GtkWindowExt::set_decorated.

Returns

true if the window has been set to have decorations

fn get_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.

width

location to store the default width, or None

height

location to store the default height, or None

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

Returns the default widget for self. See GtkWindowExt::set_default for more details.

Returns

the default widget, or None if there is none.

fn get_deletable(&self) -> bool

Returns whether the window has been set to have a close button via GtkWindowExt::set_deletable.

Returns

true if the window has been set to have a close button

fn get_destroy_with_parent(&self) -> bool

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

Returns

true if the window will be destroyed with its transient parent.

fn get_focus(&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.

Returns

the currently focused widget, or None if there is none.

fn get_focus_on_map(&self) -> bool

Gets the value set by GtkWindowExt::set_focus_on_map.

Returns

true if window should receive the input focus when mapped.

fn get_focus_visible(&self) -> bool

Gets the value of the Window:focus-visible property.

Returns

true if “focus rectangles” are supposed to be visible in this window.

fn get_gravity(&self) -> Gravity

Gets the value set by GtkWindowExt::set_gravity.

Returns

window gravity

fn get_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.

Returns

the WindowGroup for a window or the default group

fn get_hide_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 ().

Returns

true if the window has requested to have its titlebar hidden when maximized

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

Gets the value set by GtkWindowExt::set_icon (or if you've called GtkWindowExt::set_icon_list, gets the first icon in the icon list).

Returns

icon for window or None if none

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

Retrieves the list of icons set by GtkWindowExt::set_icon_list. The list is copied, but the reference count on each member won’t be incremented.

Returns

copy of window’s icon list

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

Returns the name of the themed icon for the window, see GtkWindowExt::set_icon_name.

Returns

the icon name or None if the window has no themed icon

fn get_mnemonic_modifier(&self) -> ModifierType

Returns the mnemonic modifier for this window. See GtkWindowExt::set_mnemonic_modifier.

Returns

the modifier mask used to activate mnemonics on this window.

fn get_mnemonics_visible(&self) -> bool

Gets the value of the Window:mnemonics-visible property.

Returns

true if mnemonics are supposed to be visible in this window.

fn get_modal(&self) -> bool

Returns whether the window is modal. See GtkWindowExt::set_modal.

Returns

true if the window is set to be modal and establishes a grab when shown

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

This function returns the position you need to pass to GtkWindowExt::move to keep self in its current position. This means that the meaning of the returned value varies with window gravity. See GtkWindowExt::move for more details.

The reliability of this function depends on the windowing system currently in use. Some windowing systems, such as Wayland, do not support a global coordinate system, and thus the position of the window will always be (0, 0). Others, like X11, do not have a reliable way to obtain the geometry of the decorations of a window if they are provided by the window manager. Additionally, on X11, window manager have been known to mismanage window gravity, which result in windows moving even if you use the coordinates of the current position as returned by this function.

If you haven’t changed the window gravity, its gravity will be gdk::Gravity::NorthWest. This means that GtkWindowExt::get_position gets the position of the top-left corner of the window manager frame for the window. GtkWindowExt::move sets the position of this same top-left corner.

If a window has gravity gdk::Gravity::Static the window manager frame is not relevant, and thus GtkWindowExt::get_position will always produce accurate results. However you can’t use static gravity to do things like place a window in a corner of the screen, because static gravity ignores the window manager decorations.

Ideally, this function should return appropriate values if the window has client side decorations, assuming that the windowing system supports global coordinates.

In practice, saving the window position should not be left to applications, as they lack enough knowledge of the windowing system and the window manager state to effectively do so. The appropriate way to implement saving the window position is to use a platform-specific protocol, wherever that is available.

root_x

return location for X coordinate of gravity-determined reference point, or None

root_y

return location for Y coordinate of gravity-determined reference point, or None

fn get_resizable(&self) -> bool

Gets the value set by GtkWindowExt::set_resizable.

Returns

true if the user can resize the window

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

Returns the role of the window. See GtkWindowExt::set_role for further explanation.

Returns

the role of the window if set, or None. The returned is owned by the widget and must not be modified or freed.

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

Obtains the current size of self.

If self is not visible on screen, this function return the size GTK+ will suggest to the [window manager][gtk-X11-arch] for the initial window size (but this is not reliably the same as the size the window manager will actually select). See: GtkWindowExt::set_default_size.

Depending on the windowing system and the window manager constraints, the size returned by this function may not match the size set using GtkWindowExt::resize; additionally, since GtkWindowExt::resize may be implemented as an asynchronous operation, GTK+ cannot guarantee in any way that this code:

  // width and height are set elsewhere
  gtk_window_resize (window, width, height);

  int new_width, new_height;
  gtk_window_get_size (window, &new_width, &new_height);

will result in new_width and new_height matching width and height, respectively.

This function will return the logical size of the Window, excluding the widgets used in client side decorations; there is, however, no guarantee that the result will be completely accurate because client side decoration may include widgets that depend on the user preferences and that may not be visibile at the time you call this function.

The dimensions returned by this function are suitable for being stored across sessions; use GtkWindowExt::set_default_size to restore them when before showing the window.

To avoid potential race conditions, you should only call this function in response to a size change notification, for instance inside a handler for the Widget::size-allocate signal, or inside a handler for the Widget::configure-event signal:

static void
on_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
  int new_width, new_height;

  gtk_window_get_size (GTK_WINDOW (widget), &new_width, &new_height);

  ...
}

Note that, if you connect to the Widget::size-allocate signal, you should not use the dimensions of the Allocation passed to the signal handler, as the allocation may contain client side decorations added by GTK+, depending on the windowing system in use.

If you are getting a window size in order to position the window on the screen, you should, instead, simply set the window’s semantic type with GtkWindowExt::set_type_hint, which allows the window manager to e.g. center dialogs. Also, if you set the transient parent of dialogs with GtkWindowExt::set_transient_for window managers will often center the dialog over its parent window. It's much preferred to let the window manager handle these cases rather than doing it yourself, because all apps will behave consistently and according to user or system preferences, if the window manager handles it. Also, the window manager can take into account the size of the window decorations and border that it may add, and of which GTK+ has no knowledge. Additionally, positioning windows in global screen coordinates may not be allowed by the windowing system. For more information, see: GtkWindowExt::set_position.

width

return location for width, or None

height

return location for height, or None

fn get_skip_pager_hint(&self) -> bool

Gets the value set by GtkWindowExt::set_skip_pager_hint.

Returns

true if window shouldn’t be in pager

fn get_skip_taskbar_hint(&self) -> bool

Gets the value set by GtkWindowExt::set_skip_taskbar_hint

Returns

true if window shouldn’t be in taskbar

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

Retrieves the title of the window. See GtkWindowExt::set_title.

Returns

the title of the window, or None if none has been set explicitly. The returned string is owned by the widget and must not be modified or freed.

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

Returns the custom titlebar that has been set with GtkWindowExt::set_titlebar.

Feature: v3_16

Returns

the custom titlebar, or None

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

Fetches the transient parent for this window. See GtkWindowExt::set_transient_for.

Returns

the transient parent for this window, or None if no transient parent has been set.

fn get_type_hint(&self) -> WindowTypeHint

Gets the type hint for this window. See GtkWindowExt::set_type_hint.

Returns

the type hint for self.

fn get_urgency_hint(&self) -> bool

Gets the value set by GtkWindowExt::set_urgency_hint

Returns

true if window is urgent

fn get_window_type(&self) -> WindowType

Gets the type of the window. See WindowType.

Returns

the type of the window

fn has_group(&self) -> bool

Returns whether self has an explicit window group.

Returns

true if self has an explicit window group.

Since 2.22

fn has_toplevel_focus(&self) -> bool

Returns whether the input focus is within this Window. For real toplevel windows, this is identical to GtkWindowExt::is_active, but for embedded windows, like Plug, the results will differ.

Returns

true if the input focus is within this Window

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.

It’s permitted to call this function before showing a window, in which case the window will be iconified before it ever appears onscreen.

You can track iconification via the “window-state-event” signal on Widget.

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 GtkWindowExt::has_toplevel_focus

Returns

true if the window part of the current active window.

fn is_maximized(&self) -> bool

Retrieves the current maximized state of self.

Note that since maximization is ultimately handled by the window manager and happens asynchronously to an application request, you shouldn’t assume the return value of this function changing immediately (or at all), as an effect of calling GtkWindowExt::maximize or GtkWindowExt::unmaximize.

Returns

whether the window has a maximized state.

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.

It’s permitted to call this function before showing a window, in which case the window will be maximized when it appears onscreen initially.

You can track maximization via the “window-state-event” signal on Widget, or by listening to notifications on the Window:is-maximized property.

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

Activates the targets associated with the mnemonic.

keyval

the mnemonic

modifier

the modifiers

Returns

true if the activation is done.

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

fn parse_geometry(&self, geometry: &str) -> bool

Parses a standard X Window System geometry string - see the manual page for X (type “man X”) for details on this. GtkWindowExt::parse_geometry does work on all GTK+ ports including Win32 but is primarily intended for an X environment.

If either a size or a position can be extracted from the geometry string, GtkWindowExt::parse_geometry returns true and calls GtkWindowExt::set_default_size and/or GtkWindowExt::move to resize/move the window.

If GtkWindowExt::parse_geometry returns true, it will also set the gdk::WindowHints::UserPos and/or gdk::WindowHints::UserSize hints indicating to the window manager that the size/position of the window was user-specified. This causes most window managers to honor the geometry.

Note that for GtkWindowExt::parse_geometry to work as expected, it has to be called when the window has its “final” size, i.e. after calling WidgetExt::show_all on the contents and GtkWindowExt::set_geometry_hints on the window.

#include <gtk/gtk.h>

static void
fill_with_content (GtkWidget *vbox)
{
  // fill with content...
}

int
main (int argc, char *argv[])
{
  GtkWidget *window, *vbox;
  GdkGeometry size_hints = {
    100, 50, 0, 0, 100, 50, 10,
    10, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
  };

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);

  gtk_container_add (GTK_CONTAINER (window), vbox);
  fill_with_content (vbox);
  gtk_widget_show_all (vbox);

  gtk_window_set_geometry_hints (GTK_WINDOW (window),
                      NULL,
                    &size_hints,
                    GDK_HINT_MIN_SIZE |
                    GDK_HINT_BASE_SIZE |
                    GDK_HINT_RESIZE_INC);

  if (argc > 1)
    {
      gboolean res;
      res = gtk_window_parse_geometry (GTK_WINDOW (window),
                                       argv[1]);
      if (! res)
        fprintf (stderr,
                 "Failed to parse “%s”\n",
                 argv[1]);
    }

  gtk_widget_show_all (window);
  gtk_main ();

  return 0;
}

Deprecated since 3.20

Geometry handling in GTK is deprecated.

geometry

geometry string

Returns

true if string was parsed successfully

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.

If self is hidden, this function calls WidgetExt::show as well.

This function should be used when the user tries to open a window that’s already open. Say for example the preferences dialog is currently open, and the user chooses Preferences from the menu a second time; use Window::present to move the already-open dialog where the user can see it.

Presents a window to the user in response to a user interaction. The timestamp should be gathered when the window was requested to be shown (when clicking a link for example), rather than once the window is ready to be shown.

timestamp

the timestamp of the user interaction (typically a button or key press event) which triggered this call

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.

event

a gdk::EventKey

Returns

true if a widget in the focus chain handled the event.

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

Reverses the effects of GtkWindowExt::add_accel_group.

accel_group

a AccelGroup

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

Removes a mnemonic from this window.

keyval

the mnemonic

target

the widget that gets activated by the mnemonic

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.

If GtkWindowExt::resize is called before showing a window for the first time, it overrides any default size set with GtkWindowExt::set_default_size.

Windows may not be resized smaller than 1 by 1 pixels.

When using client side decorations, GTK+ will do its best to adjust the given size so that the resulting window size matches the requested size without the title bar, borders and shadows added for the client side decorations, but there is no guarantee that the result will be totally accurate because these widgets added for client side decorations depend on the theme and may not be realized or visible at the time GtkWindowExt::resize is issued.

If the Window has a titlebar widget (see GtkWindowExt::set_titlebar), then typically, GtkWindowExt::resize will compensate for the height of the titlebar widget only if the height is known when the resulting Window configuration is issued. For example, if new widgets are added after the Window configuration and cause the titlebar widget to grow in height, this will result in a window content smaller that specified by GtkWindowExt::resize and not a larger window.

width

width in pixels to resize the window to

height

height in pixels to resize the window to

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

Like GtkWindowExt::resize, but width and height are interpreted in terms of the base size and increment set with gtk_window_set_geometry_hints.

Deprecated since 3.20

This function does nothing. Use GtkWindowExt::resize and compute the geometry yourself.

width

width in resize increments to resize the window to

height

height in resize increments to resize the window to

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.

setting

true to let this window receive input focus

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

Sets or unsets the Application associated with the window.

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

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

This is equivalent to calling GtkApplicationExt::remove_window and/or GtkApplicationExt::add_window on the old/new applications as relevant.

application

a Application, or None to unset

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

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.

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

Note that this function should not be confused with GtkWindowExt::set_transient_for, which specifies a window manager relation between two toplevels instead.

Passing None for attach_widget detaches the window.

attach_widget

a Widget, or None

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.

On Windows, this function always works, since there’s no window manager policy involved.

setting

true to decorate the window

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

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.

default_widget

widget to be the default, or None to unset the default widget for the toplevel

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

Like GtkWindowExt::set_default_size, but width and height are interpreted in terms of the base size and increment set with gtk_window_set_geometry_hints.

Deprecated since 3.20

This function does nothing. If you want to set a default size, use GtkWindowExt::set_default_size instead.

width

width in resize increments, or -1 to unset the default width

height

height in resize increments, or -1 to unset the default height

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 (GtkWindowExt::set_geometry_hints can be used to set these explicitly), the default size will be clamped to the nearest permitted size.

Unlike WidgetExt::set_size_request, which sets a size request for a widget and thus would keep users from shrinking the window, this function only sets the initial size, just as if the user had resized the window themselves. Users can still shrink the window again as they normally would. Setting a default size of -1 means to use the “natural” default size (the size request of the window).

For more control over a window’s initial size and how resizing works, investigate GtkWindowExt::set_geometry_hints.

For some uses, GtkWindowExt::resize is a more appropriate function. GtkWindowExt::resize changes the current size of the window, rather than the size to be used on initial display. GtkWindowExt::resize always affects the window itself, not the geometry widget.

The default size of a window only affects the first time a window is shown; if a window is hidden and re-shown, it will remember the size it had prior to hiding, rather than using the default size.

Windows can’t actually be 0x0 in size, they must be at least 1x1, but passing 0 for width and height is OK, resulting in a 1x1 default size.

If you use this function to reestablish a previously saved window size, note that the appropriate size to save is the one returned by GtkWindowExt::get_size. Using the window allocation directly will not work in all circumstances and can lead to growing or shrinking windows.

width

width in pixels, or -1 to unset the default width

height

height in pixels, or -1 to unset the default height

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.

On Windows, this function always works, since there’s no window manager policy involved.

setting

true to decorate the window as deletable

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.

setting

whether to destroy self with its transient parent

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

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.

focus

widget to be the new focus widget, or None to unset any focus widget for the toplevel window.

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.

setting

true to let this window receive input focus on map

fn set_focus_visible(&self, setting: bool)

Sets the Window:focus-visible property.

setting

the new value

fn set_geometry_hints<P: IsA<Widget>>(
    &self,
    geometry_widget: Option<&P>,
    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.

geometry_widget

widget the geometry hints used to be applied to or None. Since 3.20 this argument is ignored and GTK behaves as if None was set.

geometry

struct containing geometry information or None

geom_mask

mask indicating which struct fields should be paid attention to

fn set_gravity(&self, gravity: Gravity)

Window gravity defines the meaning of coordinates passed to GtkWindowExt::move. See GtkWindowExt::move and gdk::Gravity for more details.

The default window gravity is gdk::Gravity::NorthWest which will typically “do what you mean.”

gravity

window gravity

fn set_has_user_ref_count(&self, setting: bool)

Tells GTK+ whether to drop its extra reference to the window when WidgetExt::destroy is called.

This function is only exported for the benefit of language bindings which may need to keep the window alive until their wrapper object is garbage collected. There is no justification for ever calling this function in an application.

setting

the new value

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.

Note that custom titlebars set with GtkWindowExt::set_titlebar are not affected by this. The application is in full control of their content and visibility anyway.

setting

whether to hide the titlebar when self is maximized

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.

The icon should be provided in whatever size it was naturally drawn; that is, don’t scale the image before passing it to GTK+. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.

If you have your icon hand-drawn in multiple sizes, use GtkWindowExt::set_icon_list. Then the best size will be used.

This function is equivalent to calling GtkWindowExt::set_icon_list with a 1-element list.

See also Window::set_default_icon_list to set the icon for all windows in your application in one go.

icon

icon image, or None

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

Sets the icon for self. Warns on failure if err is None.

This function is equivalent to calling GtkWindowExt::set_icon with a pixbuf created by loading the image from filename.

filename

location of icon file

Returns

true if setting the icon succeeded.

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.

GtkWindowExt::set_icon_list allows you to pass in the same icon in several hand-drawn sizes. The list should contain the natural sizes your icon is available in; that is, don’t scale the image before passing it to GTK+. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.

By passing several sizes, you may improve the final image quality of the icon, by reducing or eliminating automatic image scaling.

Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger images (64x64, 128x128) if you have them.

See also Window::set_default_icon_list to set the icon for all windows in your application in one go.

Note that transient windows (those who have been set transient for another window using GtkWindowExt::set_transient_for) will inherit their icon from their transient parent. So there’s no need to explicitly set the icon on transient windows.

list

list of gdk_pixbuf::Pixbuf

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.

Note that this has nothing to do with the WM_ICON_NAME property which is mentioned in the ICCCM.

name

the name of the themed icon

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.

It’s permitted to call this function before showing a window, in which case the window will be kept above when it appears onscreen initially.

You can track the above state via the “window-state-event” signal on Widget.

Note that, according to the Extended Window Manager Hints Specification, the above state is mainly meant for user preferences and should not be used by applications e.g. for drawing attention to their dialogs.

setting

whether to keep self above other windows

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.

It’s permitted to call this function before showing a window, in which case the window will be kept below when it appears onscreen initially.

You can track the below state via the “window-state-event” signal on Widget.

Note that, according to the Extended Window Manager Hints Specification, the above state is mainly meant for user preferences and should not be used by applications e.g. for drawing attention to their dialogs.

setting

whether to keep self below other windows

fn set_mnemonic_modifier(&self, modifier: ModifierType)

Sets the mnemonic modifier for this window.

modifier

the modifier mask used to activate mnemonics on this window.

fn set_mnemonics_visible(&self, setting: bool)

Sets the Window:mnemonics-visible property.

setting

the new value

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 GtkWindowExt::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.

whether the window is modal

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.

position

a position constraint.

fn set_resizable(&self, resizable: bool)

Sets whether the user can resize a window. Windows are user resizable by default.

resizable

true if the user can resize this window

fn set_role(&self, role: &str)

This function is only useful on X11, not with other GTK+ targets.

In combination with the window title, the window role allows a [window manager][gtk-X11-arch] to identify "the same" window when an application is restarted. So for example you might set the “toolbox” role on your app’s toolbox window, so that when the user restarts their session, the window manager can put the toolbox back in the same place.

If a window already has a unique title, you don’t need to set the role, since the WM can use the title to identify the window when restoring the session.

role

unique identifier for the window to be used when restoring a session

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.

screen

a gdk::Screen.

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

setting

true to keep this window from appearing in the pager

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.

setting

true to keep this window from appearing in the task bar

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 gdk::Window. 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 Window::present or any equivalent function generating a window map event.

This function is only useful on X11, not with other GTK+ targets.

startup_id

a string with startup-notification identifier

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.

title

title of the window

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

Sets a custom titlebar for self.

A typical widget used here is HeaderBar, as it provides various features expected of a titlebar while allowing the addition of child widgets to it.

If you set a custom titlebar, GTK+ will do its best to convince the window manager not to put its own titlebar on the window. Depending on the system, this function may not work for a window that is already visible, so you set the titlebar before calling WidgetExt::show.

titlebar

the widget to use as titlebar

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

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. Dialog::new_with_buttons and other convenience functions in GTK+ will sometimes call GtkWindowExt::set_transient_for on your behalf.

Passing None for parent unsets the current transient window.

On Wayland, this function can also be used to attach a new WindowType::Popup to a WindowType::Toplevel parent already mapped on screen so that the WindowType::Popup will be created as a subsurface-based window gdk::WindowType::Subsurface which can be positioned at will relatively to the WindowType::Toplevel surface.

On Windows, this function puts the child window on top of the parent, much as the window manager would have done on X.

parent

parent window, or None

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.

This function should be called before the window becomes visible.

Dialog::new_with_buttons and other convenience functions in GTK+ will sometimes call GtkWindowExt::set_type_hint on your behalf.

hint

the window type

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.

setting

true to mark this window as urgent

fn set_wmclass(&self, wmclass_name: &str, wmclass_class: &str)

Don’t use this function. It sets the X Window System “class” and “name” hints for a window. According to the ICCCM, you should always set these to the same value for all windows in an application, and GTK+ sets them to that value by default, so calling this function is sort of pointless. However, you may want to call GtkWindowExt::set_role on each window in your application, for the benefit of the session manager. Setting the role allows the window manager to restore window positions when loading a saved session.

Deprecated since 3.22

wmclass_name

window name hint

wmclass_class

window class hint

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.

It’s permitted to call this function before showing a window.

You can track stickiness via the “window-state-event” signal on Widget.

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.

You can track the fullscreen state via the “window-state-event” signal on Widget.

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.

You can track maximization via the “window-state-event” signal on Widget.

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 stuck. Just don’t write code that crashes if not.

You can track stickiness via the “window-state-event” signal on Widget.

fn get_property_default_height(&self) -> i32

fn set_property_default_height(&self, default_height: i32)

fn get_property_default_width(&self) -> i32

fn set_property_default_width(&self, default_width: i32)

fn get_property_has_toplevel_focus(&self) -> bool

fn get_property_is_active(&self) -> bool

fn get_property_is_maximized(&self) -> bool

fn get_property_type(&self) -> WindowType

fn get_property_window_position(&self) -> WindowPosition

fn set_property_window_position(&self, window_position: WindowPosition)

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

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

fn emit_activate_default(&self)

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

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

fn emit_activate_focus(&self)

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

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

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

toggle

toggle the debugger

Returns

true if the key binding was handled

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading content...

Implementors

impl<O: IsA<Window>> GtkWindowExt for O[src]

Loading content...