summary refs log tree commit diff stats
path: root/examples/gtk/ex1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gtk/ex1.nim')
-rw-r--r--examples/gtk/ex1.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/gtk/ex1.nim b/examples/gtk/ex1.nim
new file mode 100644
index 000000000..aa3ed2f66
--- /dev/null
+++ b/examples/gtk/ex1.nim
@@ -0,0 +1,14 @@
+import 

+  cairo, glib2, gtk2

+

+proc destroy(widget: pGtkWidget, data: pgpointer) {.cdecl.} =

+  gtk_main_quit()

+

+var

+  window: pGtkWidget

+gtk_nimrod_init()

+window = gtk_window_new(GTK_WINDOW_TOPLEVEL)

+discard gtk_signal_connect(GTKOBJECT(window), "destroy",

+                   GTK_SIGNAL_FUNC(destroy), nil)

+gtk_widget_show(window)

+gtk_main()