On Wed, 16 Mar 2016 18:18:24 GMT, Antonio Corbi wrote:

On Thu, 10 Mar 2016 19:44:27 +0100, Mike Wey wrote:

On 03/10/2016 09:24 AM, Russel Winder wrote:

Do people use Glade for creating their GtkD applications or is everyone manually building their widget forest?

Personally i am building my "forest" manually, i know there are people
that use glade. Mainly because there have been some questions / bug
reports about gtk.Builder.

I use glade to build the UI of my apps. Currently I'm trying to use Builder.connectSignals like this:

uib.addCallbackSymbol("gtkmainquit", cast(GCallback)&quitApp);
uib.connectSignals(cast(void*)this)

But the addCallbackSymbol method expects a GCallback second paramater. So, how can I make the userData ("this" in my case) to get into my callback function? (GCallbacks do not expect any parameter), how can I recover 'this' inside the quitApp function?.

OK, I think I got it.
Just in case someone would like to know:

class MainWindow : ApplicationWindow {
....
public void loadUiFrom (string uifile) {

uib = new UiBuilder (uifile);
...
uib.addCallbackSymbol("gtk_main_quit", cast(GCallback) &myquit);
uib.connectSignals (cast(void*)this);

}

extern (C) static void myquit (ImageMenuItem mi, MainWindow w) {

writeln("should quit.");
writeln ("Yes, now it works!");

w.close;

}
...
}