examples/lib use the new wrappers
This commit is contained in:
parent
ddb7185482
commit
b559285b78
133 changed files with 17038 additions and 151734 deletions
|
|
@ -2,20 +2,21 @@
|
|||
import
|
||||
glib2, gtk2
|
||||
|
||||
proc destroy(widget: pGtkWidget, data: pgpointer){.cdecl.} =
|
||||
gtk_main_quit()
|
||||
proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
|
||||
main_quit()
|
||||
|
||||
var
|
||||
window: PGtkWidget
|
||||
button: PGtkWidget
|
||||
window: PWidget
|
||||
button: PWidget
|
||||
|
||||
nimrod_init()
|
||||
window = window_new(WINDOW_TOPLEVEL)
|
||||
button = button_new_with_label("Click me")
|
||||
set_border_width(PContainer(Window), 5)
|
||||
add(PContainer(window), button)
|
||||
discard signal_connect(window, "destroy",
|
||||
SIGNAL_FUNC(ex2.destroy), nil)
|
||||
show(button)
|
||||
show(window)
|
||||
main()
|
||||
|
||||
gtk_nimrod_init()
|
||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL)
|
||||
button = gtk_button_new_with_label("Click me")
|
||||
gtk_container_set_border_width(GTK_CONTAINER(Window), 5)
|
||||
gtk_container_add(GTK_Container(window), button)
|
||||
discard gtk_signal_connect(GTKOBJECT(window), "destroy",
|
||||
GTK_SIGNAL_FUNC(destroy), nil)
|
||||
gtk_widget_show(button)
|
||||
gtk_widget_show(window)
|
||||
gtk_main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue