ApplicationWindowExt

Trait ApplicationWindowExt 

Source
pub trait ApplicationWindowExt: IsA<ApplicationWindow> + 'static {
    // Provided methods
    fn help_overlay(&self) -> Option<ShortcutsWindow> { ... }
    fn id(&self) -> u32 { ... }
    fn shows_menubar(&self) -> bool { ... }
    fn set_help_overlay(&self, help_overlay: Option<&ShortcutsWindow>) { ... }
    fn set_show_menubar(&self, show_menubar: bool) { ... }
    fn connect_save_state<F: Fn(&Self, &VariantDict) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_show_menubar_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all ApplicationWindow methods.

§Implementors

ApplicationWindow

Provided Methods§

Source

fn help_overlay(&self) -> Option<ShortcutsWindow>

👎Deprecated: Since 4.18

Gets the ShortcutsWindow that is associated with @self.

See set_help_overlay().

§Deprecated since 4.18

ShortcutsWindow will be removed in GTK 5

§Returns

the help overlay associated with the window

Source

fn id(&self) -> u32

Returns the unique ID of the window.

If the window has not yet been added to a Application, returns 0.

§Returns

the unique ID for the window, or 0 if the window has not yet been added to an application

Source

fn shows_menubar(&self) -> bool

Returns whether the window will display a menubar for the app menu and menubar as needed.

§Returns

True if the window will display a menubar when needed

Source

fn set_help_overlay(&self, help_overlay: Option<&ShortcutsWindow>)

👎Deprecated: Since 4.18

Associates a shortcuts window with the application window.

Additionally, sets up an action with the name win.show-help-overlay to present it.

The window takes responsibility for destroying the help overlay.

§Deprecated since 4.18

ShortcutsWindow will be removed in GTK 5

§help_overlay

a shortcuts window

Source

fn set_show_menubar(&self, show_menubar: bool)

Sets whether the window will display a menubar for the app menu and menubar as needed.

§show_menubar

whether to show a menubar when needed

Source

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

Available on crate feature v4_22 only.

The handler for this signal should persist any application-specific state of @window into @dict.

Note that window management state such as maximized, fullscreen, or window size should not be saved as part of this, they are handled by GTK.

You must be careful to be robust in the face of app upgrades and downgrades: the @state might have been created by a previous or occasionally even a future version of your app. Do not assume that a given key exists in the state. Apps must try to restore state saved by a previous version, but are free to discard state if it was written by a future version.

See restore-window.

§dict

a dictionary of type a{sv}

§Returns

true to stop stop further handlers from running

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§