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

Samples C: GtkApplicationWindow.c sample code

parent a3f39237
<page xmlns="http://projectmallard.org/1.0/"
xmlns:xi="http://www.w3.org/2001/XInclude"
type="guide" style="task"
id="GtkApplicationWindow.c">
<info>
<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>
<email>tiffany.antopolski@gmail.com</email>
<years>2012</years>
</credit>
<desc>A toplevel window which can contain other widgets, and support GMenu</desc>
</info>
<title>ApplicationWindow</title>
<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>
</code>
<p>
In this sample we used the following:
</p>
<list>
<item><p><link href="http://developer.gnome.org/gtk3/3.4/GtkApplication.html">GtkApplication</link></p></item>
<item><p><link href="http://developer.gnome.org/gtk3/3.4/GtkApplicationWindow.html">GtkApplicationWindow</link></p></item>
</list>
</page>
#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));
}
int
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/grid.py \
samples/GtkApplicationWindow.c \
samples/GtkApplicationWindow.vala \
samples/label.vala \
samples/messagedialog.vala \
......@@ -80,6 +81,7 @@ DOC_PAGES = \
getting-ready.page \
grid.js.page \
grid.py.page \
GtkApplication.c.page \
GtkApplication.vala.page \
GtkApplicationWindow.vala.page \
guitar-tuner.c.page \
......
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