Mercurial > mxe-octave
annotate src/gtk-test.c @ 748:8af5942cc9ad
test program for package gtk
author | Volker Grabsch <vog@notjusthosting.com> |
---|---|
date | Tue, 16 Feb 2010 00:48:52 +0100 |
parents | |
children | 35a9e556c82c |
rev | line source |
---|---|
748
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
1 /* This file is part of mingw-cross-env. */ |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
2 /* See doc/index.html for further information. */ |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
3 |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
4 #include <gtk/gtk.h> |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
5 |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
6 int main(int argc, char* argv[]) |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
7 { |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
8 GtkWidget* window; |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
9 GtkWidget* button; |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
10 |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
11 gtk_init(&argc, &argv); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
12 |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
13 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
14 button = gtk_button_new_with_label("Hello World"); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
15 gtk_container_add(GTK_CONTAINER(window), button); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
16 |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
17 g_signal_connect_swapped( |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
18 G_OBJECT(button), "clicked", |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
19 G_CALLBACK(gtk_widget_destroy), G_OBJECT(window)); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
20 |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
21 g_signal_connect( |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
22 G_OBJECT(window), "destroy", |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
23 G_CALLBACK(gtk_main_quit), NULL); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
24 |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
25 gtk_widget_show(button); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
26 gtk_widget_show(window); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
27 gtk_main(); |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
28 return 0; |
8af5942cc9ad
test program for package gtk
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
29 } |