diff options
author | Araq <rumpf_a@web.de> | 2015-03-29 13:16:22 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-03-29 13:16:22 +0200 |
commit | edc4940c26dc6f90faeccac0d7752446667e9551 (patch) | |
tree | b2c05f0ecbb95d09245bf419940ec30a46355b41 /tests/misc/tgtk.nim | |
parent | 165619552a7ad0fa4f594963ee0441dd711edfd4 (diff) | |
download | Nim-edc4940c26dc6f90faeccac0d7752446667e9551.tar.gz |
doc updates; fixes 'inc' for 'char'
Diffstat (limited to 'tests/misc/tgtk.nim')
-rw-r--r-- | tests/misc/tgtk.nim | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/tests/misc/tgtk.nim b/tests/misc/tgtk.nim deleted file mode 100644 index 82227689d..000000000 --- a/tests/misc/tgtk.nim +++ /dev/null @@ -1,53 +0,0 @@ -discard """ - disabled: true -""" -import - gtk2, glib2, atk, gdk2, gdk2pixbuf, libglade2, pango, - pangoutils - -proc hello(widget: PWidget, data: pointer) {.cdecl.} = - write(stdout, "Hello World\n") - -proc delete_event(widget: PWidget, event: PEvent, - data: pointer): bool {.cdecl.} = - # If you return FALSE in the "delete_event" signal handler, - # GTK will emit the "destroy" signal. Returning TRUE means - # you don't want the window to be destroyed. - # This is useful for popping up 'are you sure you want to quit?' - # type dialogs. - write(stdout, "delete event occurred\n") - # Change TRUE to FALSE and the main window will be destroyed with - # a "delete_event". - return false - -# Another callback -proc mydestroy(widget: PWidget, data: pointer) {.cdecl.} = - gtk2.main_quit() - -proc mymain() = - # GtkWidget is the storage type for widgets - gtk2.nimrod_init() - var window = window_new(gtk2.WINDOW_TOPLEVEL) - discard g_signal_connect(window, "delete_event", - Gcallback(delete_event), nil) - discard g_signal_connect(window, "destroy", Gcallback(mydestroy), nil) - # Sets the border width of the window. - set_border_width(window, 10) - - # Creates a new button with the label "Hello World". - var button = button_new("Hello World") - - discard g_signal_connect(button, "clicked", Gcallback(hello), nil) - - # This packs the button into the window (a gtk container). - add(window, button) - - # The final step is to display this newly created widget. - show(button) - - # and the window - show(window) - - gtk2.main() - -mymain() |