0.2 snapshot
[himkr] / src / test.c
diff --git a/src/test.c b/src/test.c
new file mode 100644 (file)
index 0000000..41d21a8
--- /dev/null
@@ -0,0 +1,37 @@
+#include <hildon/hildon-program.h>
+#include <gtk/gtkmain.h>
+#include <gtk/gtkbutton.h>
+
+int main(int argc, char *argv[])
+{
+    /* Create needed variables */
+    HildonProgram *program;
+    HildonWindow *window;
+    GtkWidget *button;
+
+    /* Initialize the GTK. */
+    gtk_init(&argc, &argv);
+
+    /* Create the hildon program and setup the title */
+    program = HILDON_PROGRAM(hildon_program_get_instance());
+    g_set_application_name("Hello maemo!");
+
+    /* Create HildonWindow and set it to HildonProgram */
+    window = HILDON_WINDOW(hildon_window_new());
+    hildon_program_add_window(program, window);
+
+    /* Create button and add it to main view */
+    button = gtk_button_new_with_label("Hello!");
+    gtk_container_add(GTK_CONTAINER(window), button);
+
+    /* Connect signal to X in the upper corner */
+    g_signal_connect(G_OBJECT(window), "delete_event",
+      G_CALLBACK(gtk_main_quit), NULL);
+
+    /* Begin the main application */
+    gtk_widget_show_all(GTK_WIDGET(window));
+    gtk_main();
+
+    /* Exit */
+    return 0;
+}