ClientExt

Trait ClientExt 

Source
pub trait ClientExt: 'static {
    // Required methods
    fn accel_group(&self) -> Option<AccelGroup>;
    fn menuitem_get(&self, item: &impl IsA<Menuitem>) -> Option<MenuItem>;
    fn menuitem_get_submenu(&self, item: &impl IsA<Menuitem>) -> Option<Menu>;
    fn newitem_base(
        &self,
        item: &impl IsA<Menuitem>,
        gmi: &impl IsA<MenuItem>,
        parent: Option<&impl IsA<Menuitem>>,
    );
    fn set_accel_group(&self, agroup: &impl IsA<AccelGroup>);
}
Expand description

Trait containing all Client methods.

§Implementors

Client

Required Methods§

Source

fn accel_group(&self) -> Option<AccelGroup>

Gets the accel group for this client.

§Returns

Either a valid group or None on error or none set.

Source

fn menuitem_get(&self, item: &impl IsA<Menuitem>) -> Option<MenuItem>

This grabs the gtk::MenuItem that is associated with the dbusmenu_glib::Menuitem.

§item

dbusmenu_glib::Menuitem to get associated gtk::MenuItem on.

§Returns

The gtk::MenuItem that can be played with.

Source

fn menuitem_get_submenu(&self, item: &impl IsA<Menuitem>) -> Option<Menu>

This grabs the submenu associated with the menuitem.

§item

dbusmenu_glib::Menuitem to get associated gtk::Menu on.

§Returns

The gtk::Menu if there is one.

Source

fn newitem_base( &self, item: &impl IsA<Menuitem>, gmi: &impl IsA<MenuItem>, parent: Option<&impl IsA<Menuitem>>, )

This function provides some of the basic connectivity for being in the GTK world. Things like visibility and sensitivity of the item are handled here so that the subclasses don’t have to. If you’re building your on GTK menu item you can use this function to apply those basic attributes so that you don’t have to deal with them either.

This also handles passing the “activate” signal back to the dbusmenu_glib::Menuitem side of thing.

§item

The dbusmenu_glib::Menuitem to attach the GTK-isms to

§gmi

A gtk::MenuItem representing the GTK world’s view of this menuitem

§parent

The parent dbusmenu_glib::Menuitem

Source

fn set_accel_group(&self, agroup: &impl IsA<AccelGroup>)

Sets the acceleration group for the menu items with accelerators on this client.

§agroup

The new acceleration group

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§

Source§

impl<O: IsA<Client>> ClientExt for O