[gnome-devel-docs] Samples C: GtkApplicationWindow.c sample code
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] Samples C: GtkApplicationWindow.c sample code
- Date: Sun, 29 Apr 2012 02:24:11 +0000 (UTC)
commit 75163f4c10faf8b9bb66404ebf3d7ea0f12a390e
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Sat Apr 28 22:22:53 2012 -0400
Samples C: GtkApplicationWindow.c sample code
platform-demos/C/GtkApplicationWindow.c.page | 33 +++++++++++++++++++++++
platform-demos/C/samples/GtkApplicationWindow.c | 28 +++++++++++++++++++
platform-demos/Makefile.am | 2 +
3 files changed, 63 insertions(+), 0 deletions(-)
---
diff --git a/platform-demos/C/GtkApplicationWindow.c.page b/platform-demos/C/GtkApplicationWindow.c.page
new file mode 100644
index 0000000..639006e
--- /dev/null
+++ b/platform-demos/C/GtkApplicationWindow.c.page
@@ -0,0 +1,33 @@
+<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>
diff --git a/platform-demos/C/samples/GtkApplicationWindow.c b/platform-demos/C/samples/GtkApplicationWindow.c
new file mode 100644
index 0000000..72e9385
--- /dev/null
+++ b/platform-demos/C/samples/GtkApplicationWindow.c
@@ -0,0 +1,28 @@
+#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;
+}
diff --git a/platform-demos/Makefile.am b/platform-demos/Makefile.am
index 4977bcf..5bf9834 100644
--- a/platform-demos/Makefile.am
+++ b/platform-demos/Makefile.am
@@ -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 \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]