0.2 snapshot
[himkr] / src / test.c
1 #include <hildon/hildon-program.h>
2 #include <gtk/gtkmain.h>
3 #include <gtk/gtkbutton.h>
4
5 int main(int argc, char *argv[])
6 {
7     /* Create needed variables */
8     HildonProgram *program;
9     HildonWindow *window;
10     GtkWidget *button;
11
12     /* Initialize the GTK. */
13     gtk_init(&argc, &argv);
14
15     /* Create the hildon program and setup the title */
16     program = HILDON_PROGRAM(hildon_program_get_instance());
17     g_set_application_name("Hello maemo!");
18
19     /* Create HildonWindow and set it to HildonProgram */
20     window = HILDON_WINDOW(hildon_window_new());
21     hildon_program_add_window(program, window);
22
23     /* Create button and add it to main view */
24     button = gtk_button_new_with_label("Hello!");
25     gtk_container_add(GTK_CONTAINER(window), button);
26
27     /* Connect signal to X in the upper corner */
28     g_signal_connect(G_OBJECT(window), "delete_event",
29       G_CALLBACK(gtk_main_quit), NULL);
30
31     /* Begin the main application */
32     gtk_widget_show_all(GTK_WIDGET(window));
33     gtk_main();
34
35     /* Exit */
36     return 0;
37 }