summaryrefslogtreecommitdiff
path: root/tests/simple.c
blob: 47893772f7ccf99275ef3e5cc4096679753c9207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <gtk/gtk.h>
#include <gdk/gdkprivate.h>


void
hello ()
{
  g_print ("hello world\n");
}

int
main (int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget *button;

  gdk_progclass = g_strdup ("XTerm");
  gtk_init (&argc, &argv);

  window = gtk_widget_new (gtk_window_get_type (),
			   "GtkObject::user_data", NULL,
			   "GtkWindow::type", GTK_WINDOW_TOPLEVEL,
			   "GtkWindow::title", "hello world",
			   "GtkWindow::allow_grow", FALSE,
			   "GtkWindow::allow_shrink", FALSE,
			   "GtkContainer::border_width", 10,
			   NULL);
  button = gtk_widget_new (gtk_button_get_type (),
			   "GtkButton::label", "hello world",
			   "GtkObject::signal::clicked", hello, NULL,
			   "GtkWidget::parent", window,
			   "GtkWidget::visible", TRUE,
			   NULL);
  gtk_widget_show (window);

  gtk_main ();

  return 0;
}