Experimental GTK structs-as-references support. Not enabled by default.
[girtod.git] / example_gtk2.d
blob0a1ffa6d7e47f01e2cc680ab2d6e7d9ba6ee8456
1 import gtk = gtk2.gtk2;
3 extern (C) int delete_cb(gtk.Widget* this_, gtk.Event* event, void* user_data) {
4 import std.stdio;
5 writeln("delete_cb(", this_, ", ", event, ", ", user_data, ")");
7 gtk.exit(0);
8 return 0;
11 extern (C) int event_cb(gtk.Widget* this_, gtk.Event* event, void* user_data) {
12 gtk._dumpObj(event);
13 return 0;
16 int main(string argv[]) {
17 argv = gtk.init(argv);
19 auto window = gtk.Window.new_(gtk.WindowType.TOPLEVEL);
20 window.set_title(cast(char*)"Hello World!");
21 window.set_default_size(640, 480);
23 window.signal_connect!"event"(&event_cb, null);
24 window.signal_connect!"delete-event"(&delete_cb, null);
26 window.show_all();
28 gtk.main_();
29 return 0;