[go: up one dir, main page]

gtk4/
shortcut.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::{prelude::*, Shortcut, ShortcutAction, ShortcutTrigger};
4
5impl Shortcut {
6    #[doc(alias = "gtk_shortcut_new_with_arguments")]
7    #[doc(alias = "new_with_arguments")]
8    pub fn with_arguments(
9        trigger: Option<impl IsA<ShortcutTrigger>>,
10        action: Option<impl IsA<ShortcutAction>>,
11        args: &glib::Variant,
12    ) -> Self {
13        assert_initialized_main_thread!();
14        let shortcut = Shortcut::new(trigger, action);
15        shortcut.set_arguments(Some(args));
16        shortcut
17    }
18}