-
I want implement following clang code with gtk4-rs. Is it possible using safe methods or this feature not implemented yet? g_signal_handlers_block_by_func (entry, G_CALLBACK (editable_changed_cb), entry);
gtk_editable_set_text (GTK_EDITABLE (entry), new_url);
g_signal_handlers_unblock_by_func (entry, G_CALLBACK (editable_changed_cb), entry); |
Beta Was this translation helpful? Give feedback.
Answered by
d47081
Mar 10, 2025
Replies: 1 comment
-
Well, found the answer in using signal_handler_id: Rc<RefCell<Option<SignalHandlerId>>> then, use gtk::prelude::ObjectExt;
if let Some(signal_handler_id) =
signal_handler_id.borrow().as_ref()
{
request.block_signal(signal_handler_id);
}
request.set_text(
// change something
);
if let Some(signal_handler_id) =
signal_handler_id.borrow().as_ref()
{
request.unblock_signal(signal_handler_id);
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
d47081
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, found the answer in using
RefCell
withNone
combination, e.g.then,
signal_handler_id
should be captured somewhere outside, depending of app implementation.