[go: up one dir, main page]

gtk4/
actionable.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::{translate::*, Variant};
4
5use crate::{prelude::*, Actionable};
6
7// rustdoc-stripper-ignore-next
8/// Trait containing manually implemented methods of
9/// [`Actionable`](crate::Actionable).
10pub trait ActionableExtManual: IsA<Actionable> + 'static {
11    #[doc(alias = "gtk_actionable_set_action_target")]
12    #[doc(alias = "gtk_actionable_set_action_target_value")]
13    fn set_action_target(&self, target: Option<impl Into<Variant>>) {
14        unsafe {
15            crate::ffi::gtk_actionable_set_action_target_value(
16                self.as_ref().to_glib_none().0,
17                target.map(|v| v.into()).to_glib_none().0,
18            );
19        }
20    }
21}
22
23impl<O: IsA<Actionable>> ActionableExtManual for O {}