Trait gdk4::prelude::ToplevelExt[][src]

pub trait ToplevelExt: 'static {
Show 36 methods fn begin_move<P: IsA<Device>>(
        &self,
        device: &P,
        button: i32,
        x: f64,
        y: f64,
        timestamp: u32
    );
fn begin_resize<P: IsA<Device>>(
        &self,
        edge: SurfaceEdge,
        device: Option<&P>,
        button: i32,
        x: f64,
        y: f64,
        timestamp: u32
    );
fn focus(&self, timestamp: u32);
fn state(&self) -> ToplevelState;
fn lower(&self) -> bool;
fn minimize(&self) -> bool;
fn present(&self, layout: &ToplevelLayout);
fn restore_system_shortcuts(&self);
fn set_decorated(&self, decorated: bool);
fn set_deletable(&self, deletable: bool);
fn set_icon_list(&self, surfaces: &[Texture]);
fn set_modal(&self, modal: bool);
fn set_startup_id(&self, startup_id: &str);
fn set_title(&self, title: &str);
fn set_transient_for<P: IsA<Surface>>(&self, parent: &P);
fn supports_edge_constraints(&self) -> bool;
fn titlebar_gesture(&self, gesture: TitlebarGesture) -> bool;
fn is_decorated(&self) -> bool;
fn is_deletable(&self) -> bool;
fn fullscreen_mode(&self) -> FullscreenMode;
fn set_fullscreen_mode(&self, fullscreen_mode: FullscreenMode);
fn is_modal(&self) -> bool;
fn is_shortcuts_inhibited(&self) -> bool;
fn startup_id(&self) -> Option<GString>;
fn title(&self) -> Option<GString>;
fn transient_for(&self) -> Option<Surface>;
fn connect_decorated_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_deletable_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_fullscreen_mode_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_icon_list_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_modal_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_shortcuts_inhibited_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_startup_id_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_state_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_title_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_transient_for_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all Toplevel methods.

Implementors

Toplevel

Required methods

Begins an interactive move operation.

You might use this function to implement draggable titlebars.

device

the device used for the operation

button

the button being used to drag, or 0 for a keyboard-initiated drag

x

surface X coordinate of mouse click that began the drag

y

surface Y coordinate of mouse click that began the drag

timestamp

timestamp of mouse click that began the drag (use Event::time())

Begins an interactive resize operation.

You might use this function to implement a “window resize grip.”

edge

the edge or corner from which the drag is started

device

the device used for the operation

button

the button being used to drag, or 0 for a keyboard-initiated drag

x

surface X coordinate of mouse click that began the drag

y

surface Y coordinate of mouse click that began the drag

timestamp

timestamp of mouse click that began the drag (use Event::time())

Sets keyboard focus to surface.

In most cases, Gtk::Window::present_with_time()`` should be used on a Gtk::Window, rather than calling this function.

timestamp

timestamp of the event triggering the surface focus

Gets the bitwise or of the currently active surface state flags, from the ToplevelState enumeration.

Returns

surface state bitfield

Asks to lower the self below other windows.

The windowing system may choose to ignore the request.

Returns

true if the surface was lowered

Asks to minimize the self.

The windowing system may choose to ignore the request.

Returns

true if the surface was minimized

Present self after having processed the ToplevelLayout rules.

If the toplevel was previously not showing, it will be showed, otherwise it will change layout according to layout.

GDK may emit the signal::Toplevel::compute-size signal to let the user of this toplevel compute the preferred size of the toplevel surface.

Presenting is asynchronous and the specified layout parameters are not guaranteed to be respected.

layout

the ToplevelLayout object used to layout

Restore default system keyboard shortcuts which were previously inhibited.

This undoes the effect of ToplevelExtManual::inhibit_system_shortcuts().

Sets the toplevel to be decorated.

Setting decorated to false hints the desktop environment that the surface has its own, client-side decorations and does not need to have window decorations added.

decorated

true to request decorations

Sets the toplevel to be deletable.

Setting deletable to true hints the desktop environment that it should offer the user a way to close the surface.

deletable

true to request a delete button

Sets a list of icons for the surface.

One of these will be used to represent the surface in iconic form. The icon may be shown in window lists or task bars. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality.

Note that some platforms don’t support surface icons.

surfaces

A list of textures to use as icon, of different sizes

Sets the toplevel to be modal.

The application can use this hint to tell the window manager that a certain surface has modal behaviour. The window manager can use this information to handle modal surfaces in a special way.

You should only use this on surfaces for which you have previously called set_transient_for().

true if the surface is modal, false otherwise.

Sets the startup notification ID.

When using GTK, typically you should use Gtk::Window::set_startup_id()`` instead of this low-level function.

startup_id

a string with startup-notification identifier

Sets the title of a toplevel surface.

The title maybe be displayed in the titlebar, in lists of windows, etc.

title

title of surface

Sets a transient-for parent.

Indicates to the window manager that surface is a transient dialog associated with the application surface parent. This allows the window manager to do things like center surface on parent and keep surface above parent.

See Gtk::Window::set_transient_for()`` if you’re using Gtk::Window or Gtk::Dialog.

parent

another toplevel Surface

Returns whether the desktop environment supports tiled window states.

Returns

true if the desktop environment supports tiled window states

Whether the window manager should add decorations.

Whether the window manager should allow to close the surface.

The fullscreen mode of the surface.

The fullscreen mode of the surface.

Whether the surface is modal.

Whether the surface should inhibit keyboard shortcuts.

The startup ID of the surface.

See AppLaunchContext for more information about startup feedback.

The title of the surface.

The transient parent of the surface.

Implementors