gtk4/auto/
mnemonic_action.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{ffi, ShortcutAction};
6use glib::translate::*;
7
8glib::wrapper! {
9    /// Activates a widget with a mnemonic.
10    ///
11    /// This means that [`WidgetExt::mnemonic_activate()`][crate::prelude::WidgetExt::mnemonic_activate()] is called.
12    ///
13    /// # Implements
14    ///
15    /// [`ShortcutActionExt`][trait@crate::prelude::ShortcutActionExt], [`trait@glib::ObjectExt`]
16    #[doc(alias = "GtkMnemonicAction")]
17    pub struct MnemonicAction(Object<ffi::GtkMnemonicAction, ffi::GtkMnemonicActionClass>) @extends ShortcutAction;
18
19    match fn {
20        type_ => || ffi::gtk_mnemonic_action_get_type(),
21    }
22}
23
24impl MnemonicAction {
25    /// Gets the mnemonic action.
26    ///
27    /// This is an action that calls gtk_widget_mnemonic_activate()
28    /// on the given widget upon activation.
29    ///
30    /// # Returns
31    ///
32    /// The mnemonic action
33    #[doc(alias = "gtk_mnemonic_action_get")]
34    pub fn get() -> MnemonicAction {
35        assert_initialized_main_thread!();
36        unsafe { from_glib_none(ffi::gtk_mnemonic_action_get()) }
37    }
38}