Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

gobject_sys::g_signal_handlers_block_matched() unusable? #52

Open
hasufell opened this issue Jun 30, 2017 · 4 comments
Open

gobject_sys::g_signal_handlers_block_matched() unusable? #52

hasufell opened this issue Jun 30, 2017 · 4 comments

Comments

@hasufell
Copy link

hasufell commented Jun 30, 2017

I see no useful way to invoke gobject_sys::g_signal_handlers_block_matched().

pub fn g_signal_handlers_block_matched(
    instance: *mut GObject,
    mask: GSignalMatchType,
    signal_id: c_uint,
    detail: glib::GQuark,
    closure: *mut GClosure,
    func: gpointer,
    data: gpointer,
) -> c_uint;

The gnome documentation suggest I either need G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or G_SIGNAL_MATCH_DATA as GSignalMatchType for any match to occur.

I don't see any way to provide either of those information, because of the way the gtk bindings connect to signals, utilizing rust closures I have no access to:

@hasufell hasufell changed the title g_signal_handlers_block_matched() unusable? gobject_sys::g_signal_handlers_block_matched() unusable? Jun 30, 2017
@EPashkin
Copy link
Member

You can try G_SIGNAL_MATCH_ID while signal_id acquired by g_signal_lookup

@EPashkin
Copy link
Member

Or use glib::signal::signal_handler_block with i64 returned by connect_toggled

@hasufell
Copy link
Author

hasufell commented Jul 1, 2017

You can try G_SIGNAL_MATCH_ID while signal_id acquired by g_signal_lookup

Doesn't work with g_signal_handlers_block_matches() though:

Passing at least one of the G_SIGNAL_MATCH_CLOSURE, G_SIGNAL_MATCH_FUNC or
G_SIGNAL_MATCH_DATA match flags is required for successful matches.

Or use glib::signal::signal_handler_block with i64 returned by connect_toggled

That's certainly an option right, but g_signal_handlers_block_matches() allows more fine-grained matching, no?

@EPashkin
Copy link
Member

EPashkin commented Jul 1, 2017

Then seems really no way to use this function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants