Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

go version of: gtk_builder_connect_signals( builder, NULL ); #50

Open
comaldave opened this issue Mar 24, 2014 · 3 comments
Open

go version of: gtk_builder_connect_signals( builder, NULL ); #50

comaldave opened this issue Mar 24, 2014 · 3 comments

Comments

@comaldave
Copy link

I was following tutorial for glade and in reading this line in c++, I could not find the equivalent for go. Demo is running well otherwise. Very nice package!

/* Connect signals */
gtk_builder_connect_signals( builder, NULL );

@jrick
Copy link
Member

jrick commented Apr 1, 2014

Admittedly I don't use the Builder, but according to the gtk documentation, this connects the signals that have been already added to the builder with previous calls to gtk_builder_add_callback_symbol. I'm not sure how others use the Builder, but I think implementing gtk_builder_add_callback_symbol would have to be a first step.

The tricky part there is that gtk_builder_add_callback_symbol takes a C function pointer. I'll have to see if any of the glib closure code can be reused for this, so we would be able to call Go closures when a signal is emitted, just like when using Connect.

@marcioAlmada
Copy link

👍 this is very important

@marcioAlmada
Copy link

Just found out that go-gtk package has this implemented https://github.com/mattn/go-gtk/blob/c61f51135f7d96ba6fdccdd88fdc5eb042ec967f/gtk/gtk.go#L9938-L9940

This example might help: https://github.com/mattn/go-gtk/tree/c61f51135f7d96ba6fdccdd88fdc5eb042ec967f/example/builder

I tried to implement the same methods on gotk3 but I'm stuck with error:

(main:28716): Gtk-WARNING **: Could not find signal handler 'signalName'.  Did you compile with -rdynamic?

Anyway, hope it helps.

marcioAlmada added a commit to marcioAlmada/goremote that referenced this issue Jun 21, 2015
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