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

Connect internals #9

Closed
StephanvanSchaik opened this issue Apr 12, 2015 · 4 comments
Closed

Connect internals #9

StephanvanSchaik opened this issue Apr 12, 2015 · 4 comments

Comments

@StephanvanSchaik
Copy link

As I am running into issues with the current implementation of Connect (cfr. gtk-rs/gtk#30), I am looking at the implementation to see if I can pin-point the origin of my issues. However, within that code you can find:

ffi::glue_signal_connect(
                self.unwrap_gobject(),
                signal_name.borrow_to_glib().0,
                Some(trampoline),
                user_data_ptr
            );

Which can also be found among the FFI defintions:

    pub fn glue_signal_connect(g_object: *mut C_GObject,
                               signal: *const c_char,
                               func: Option<extern "C" fn()>,
                               user_data: *const c_void);

What exactly is glue_signal_connect? I'm asking because I can't seem to find this in Glib.

Furthermore, the Signal trait seems to have a fetch_cb method. What should this be used for? As I don't see it being used (directly) at the moment. (They are used to create the trampolines).

@gkoz
Copy link
Member

gkoz commented Apr 12, 2015

This glue function lives in gtk_glue.c. I can't say there's much point to having this glue function. The problems with closures have been discussed here: jeremyletang/rgtk#28

@GuillaumeGomez
Copy link
Member

@jeremyletang will explain this better than me.

@gkoz
Copy link
Member

gkoz commented Jun 9, 2015

I believe this question has been resolved in the process of the signals reform.

@GuillaumeGomez
Copy link
Member

I think too. I close it.

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

3 participants