Skip to main content

WidgetClassManualExt

Trait WidgetClassManualExt 

Source
pub trait WidgetClassManualExt {
    // Required methods
    fn add_shortcut(&self, shortcut: &Shortcut);
    fn add_binding_action(
        &self,
        keyval: Key,
        mods: ModifierType,
        action_name: &str,
    );
    fn install_property_action(&self, action_name: &str, property_name: &str);
    fn query_action(&self) -> WidgetActionIter ;
    fn activate_signal(&self) -> Option<SignalId>;
    fn layout_manager_type(&self) -> Type;
    fn css_name(&self) -> GString;
    fn accessible_role(&self) -> AccessibleRole;
}
Expand description

Trait containing widget class methods that can be called on any widget type at runtime, without requiring a subclass.

This trait is implemented for glib::Class<T> for any T: IsA<Widget> (e.g., Class<Widget>, Class<TextView>, Class<Button>).

§Example

use gtk::prelude::*;

let class = glib::Class::<gtk::TextView>::from_type(gtk::TextView::static_type()).unwrap();
let trigger = gtk::ShortcutTrigger::parse_string("<Meta>c").unwrap();
let shortcut = gtk::Shortcut::new(Some(trigger), Some(gtk::NamedAction::new("clipboard.copy")));
class.add_shortcut(&shortcut);

Required Methods§

Source

fn add_shortcut(&self, shortcut: &Shortcut)

Source

fn add_binding_action(&self, keyval: Key, mods: ModifierType, action_name: &str)

Source

fn install_property_action(&self, action_name: &str, property_name: &str)

Source

fn query_action(&self) -> WidgetActionIter

Source

fn activate_signal(&self) -> Option<SignalId>

Source

fn layout_manager_type(&self) -> Type

Source

fn css_name(&self) -> GString

Source

fn accessible_role(&self) -> AccessibleRole

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: IsA<Widget> + IsClass> WidgetClassManualExt for Class<T>

Source§

fn add_shortcut(&self, shortcut: &Shortcut)

Source§

fn add_binding_action(&self, keyval: Key, mods: ModifierType, action_name: &str)

Source§

fn install_property_action(&self, action_name: &str, property_name: &str)

Source§

fn query_action(&self) -> WidgetActionIter

Source§

fn activate_signal(&self) -> Option<SignalId>

Source§

fn layout_manager_type(&self) -> Type

Source§

fn css_name(&self) -> GString

Source§

fn accessible_role(&self) -> AccessibleRole

Implementors§