From: Olaf Wintermann Date: Sun, 17 May 2026 09:07:22 +0000 (+0200) Subject: add UiContext call_action method X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=739cdf428f24bb50054d422e0ca7a934a65cc32b;p=note.git add UiContext call_action method --- diff --git a/ui-rs/src/ui/toolkit.rs b/ui-rs/src/ui/toolkit.rs index d701ced..050dd1b 100644 --- a/ui-rs/src/ui/toolkit.rs +++ b/ui-rs/src/ui/toolkit.rs @@ -107,6 +107,13 @@ impl UiContext { let cstr = CString::new(name).unwrap(); ui_add_action(self.ptr, cstr.as_ptr(), Some(action_event_wrapper::), ptr as *mut c_void); } + + pub fn call_action(&self, action: &str) { + let cstr = CString::new(action).unwrap(); + unsafe { + ui_call_action(self.ptr, cstr.as_ptr()); + } + } } pub extern "C" fn destroy_boxed(data: *mut c_void) { @@ -208,10 +215,7 @@ impl UiObject { } pub fn call_action(&self, action: &str) { - let cstr = CString::new(action).unwrap(); - unsafe { - ui_call_action(self.ctx.ptr, cstr.as_ptr()); - } + self.ctx.call_action(action); } }