use gtk::{
gio::SimpleAction,
glib::{uuid_string_random, GString},
prelude::ActionExt,
};
pub struct Debug {
gobject: SimpleAction,
}
impl Debug {
pub fn new() -> Self {
Self {
gobject: SimpleAction::new(&uuid_string_random(), None),
}
}
pub fn connect_activate(&self, callback: impl Fn() + 'static) {
self.gobject.connect_activate(move |_, _| callback());
}
pub fn gobject(&self) -> &SimpleAction {
&self.gobject
}
pub fn id(&self) -> GString {
self.gobject.name()
}
}