gtk4/event_controller.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3#[cfg(feature = "v4_8")]
4use glib::translate::*;
5
6#[cfg(feature = "v4_8")]
7use crate::ffi;
8use crate::{prelude::*, EventController};
9
10pub trait EventControllerExtManual: IsA<EventController> + 'static {
11 /// Sets a name on the controller that can be used for debugging.
12 /// ## `name`
13 /// a name for @self, must be a static string
14 #[cfg(feature = "v4_8")]
15 #[cfg_attr(docsrs, doc(cfg(feature = "v4_8")))]
16 #[doc(alias = "gtk_event_controller_set_static_name")]
17 fn set_static_name(&self, name: Option<&'static glib::GStr>) {
18 unsafe {
19 ffi::gtk_event_controller_set_static_name(
20 self.as_ref().to_glib_none().0,
21 name.to_glib_none().0,
22 );
23 }
24 }
25}
26
27impl<O: IsA<EventController>> EventControllerExtManual for O {}