Sign up

Using Glade?

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

Re: Using Glade?

On Thu, 10 Mar 2016 08:24:01 GMT, Russel Winder wrote:

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

For the two apps I've done, with one exception, I didn't see much point in using Glade personally since the UI for both are relatively simple. That one exception is the preference and profile dialogs in Terminix, that might have been done cleaner and faster in Glade. If I was writing a data entry application I'd probably look at Glade more closely.

BTW, I came across this interesting project on github, it converts glade files into equivalent D source code. No experience with it though.

https://github.com/burner/gladeD

Re: Using Glade?

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.

Re: Using Glade?

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?.

Re: Using Glade?

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;

}
...
}

Re: Using Glade?

On Thu, 10 Mar 2016 08:24:01 GMT, Russel Winder wrote:

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

For my program i have used glade because the UI is big enough to be too hard for programming it by hands.

Re: Using Glade?

On Thu, 10 Mar 2016 14:21:41 GMT, Gerald Nunn wrote:

On Thu, 10 Mar 2016 08:24:01 GMT, Russel Winder wrote:

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

Just to update my answer, I just used Glade (well ui file anyways) for the first time to create the new GTK 3.20 ShortcutsWindow. No real issues with it but it was a pretty limited use case as the ui file didn't have any event handlers to wire up.