Commit 75163f4c authored by Tiffany Antopolski's avatar Tiffany Antopolski
Browse files

Samples C: GtkApplicationWindow.c sample code

parent a3f39237
<page xmlns=""
type="guide" style="task"
<link type="guide" xref="beginner.c#windows"/>
<revision version="0.1" date="2012-04-28" status="draft"/>
<credit type="author copyright">
<name>Tiffany Antopolski</name>
<desc>A toplevel window which can contain other widgets, and support GMenu</desc>
<media type="image" mime="image/png" src="media/window.png"/>
<p>A minimal GtkApplication with a GtkApplicationWindow</p>
<code mime="text/x-csrc" style="numbered">
<xi:include href="samples/GtkApplicationWindow.c" parse="text"><xi:fallback/></xi:include>
In this sample we used the following:
<item><p><link href="">GtkApplication</link></p></item>
<item><p><link href="">GtkApplicationWindow</link></p></item>
#include <gtk/gtk.h>
static void
activate (GtkApplication *app,
gpointer user_data)
GtkWidget *window;
window = gtk_application_window_new (app);
gtk_window_set_application (GTK_WINDOW (window), GTK_APPLICATION (app));
gtk_window_set_title (GTK_WINDOW (window), "Hello GNOME");
gtk_widget_show_all (GTK_WIDGET (window));
main (int argc, char **argv)
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example",G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
......@@ -25,6 +25,7 @@ demo_sources = \
samples/button.vala \
samples/dialog.vala \
samples/ \
samples/GtkApplicationWindow.c \
samples/GtkApplicationWindow.vala \
samples/label.vala \
samples/messagedialog.vala \
......@@ -80,6 +81,7 @@ DOC_PAGES = \ \ \ \ \ \ \ \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment