Hello World Example with Glade?

Mike McKee via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 10 23:45:06 PDT 2015


On Friday, 11 September 2015 at 06:00:39 UTC, Mike McKee wrote:
> On Ubuntu Linux, I can draw a simple Hello World interface (and 
> a button on it to close the window) with Glade and save the 
> file. Now how do I use GtkD and D to load that interface? 
> Anyone got a super simple tutorial for that?

I think the start of this probably looks like the following, but 
I'm not certain:

import gtk;
import gobject.Type;
import std.stdio;
import std.c.process;

int main (string[] args)
{
	Main.init(args);
	Builder b = new Builder();
	b.addFromFile("test1.glade");
	Window w = cast(Window)b.getObject("window1");
	w.showAll();
	Main.run();
	return 0;
}

...so, this assumed that I had a test1.glade file, and that I had 
this line inside it:

<object class="GtkApplicationWindow" id="window1">

So now I need to figure out how to get GtkD installed on Ubuntu 
Linux 14.04.



More information about the Digitalmars-d-learn mailing list