[gnome-devel-docs] tutorials vala: GtkApplicationWindow example
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] tutorials vala: GtkApplicationWindow example
- Date: Sat, 21 Apr 2012 15:52:03 +0000 (UTC)
commit da3f01769f75efe15811997258e4694a1ced8abc
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Sat Apr 21 11:51:16 2012 -0400
tutorials vala: GtkApplicationWindow example
platform-demos/C/GtkApplicationWindow.page | 49 ++++++++++++++++++++
platform-demos/C/media/GtkApplicationWindow.png | Bin 0 -> 4690 bytes
platform-demos/C/samples/GtkApplicationWindow.vala | 19 ++++++++
platform-demos/Makefile.am | 2 +
4 files changed, 70 insertions(+), 0 deletions(-)
---
diff --git a/platform-demos/C/GtkApplicationWindow.page b/platform-demos/C/GtkApplicationWindow.page
new file mode 100644
index 0000000..508cc17
--- /dev/null
+++ b/platform-demos/C/GtkApplicationWindow.page
@@ -0,0 +1,49 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ type="guide" style="task"
+ id="GtkApplicationWindow.vala">
+ <info>
+ <link type="guide" xref="beginner.vala#windows"/>
+ <revision version="0.1" date="2012-04-07" status="stub"/>
+
+ <credit type="author copyright">
+ <name>Tiffany Antopolski</name>
+ <email>tiffany antopolski gmail com</email>
+ <years>2012</years>
+ </credit>
+
+ <desc>GtkWindow subclass with GtkApplication support</desc>
+ </info>
+
+ <title>Application Window</title>
+ <media type="image" mime="image/png" src="media/GtkApplicationWindow.png"/>
+ <p>The simplest GtkApplication Window</p>
+
+ <code mime="text/x-vala" style="numbered"><![CDATA[
+public class MyWindow : Gtk.ApplicationWindow {
+ internal MyWindow (MyApplication app) {
+ Object (application: app, title: "My Application");
+ }
+}
+
+public class MyApplication : Gtk.Application {
+ protected override void activate () {
+ new MyWindow (this).show ();
+ }
+
+ internal MyApplication () {
+ Object (application_id: "org.example.MyApplication");
+ }
+}
+
+public int main (string[] args) {
+ return new MyApplication ().run (args);
+}
+]]></code>
+<p>
+ In this sample we used the following:
+</p>
+<list>
+ <item><p><link href="http://references.valadoc.org/gtk+-3.0/Gtk.Application.html.content.tpl">Gtk.Application</link></p></item>
+ <item><p><link href="http://references.valadoc.org/#!api=gtk+-3.0/Gtk.ApplicationWindow">Gtk.ApplicationWindow</link></p></item>
+</list>
+</page>
diff --git a/platform-demos/C/media/GtkApplicationWindow.png b/platform-demos/C/media/GtkApplicationWindow.png
new file mode 100644
index 0000000..6f6c33f
Binary files /dev/null and b/platform-demos/C/media/GtkApplicationWindow.png differ
diff --git a/platform-demos/C/samples/GtkApplicationWindow.vala b/platform-demos/C/samples/GtkApplicationWindow.vala
new file mode 100644
index 0000000..be9637a
--- /dev/null
+++ b/platform-demos/C/samples/GtkApplicationWindow.vala
@@ -0,0 +1,19 @@
+public class MyWindow : Gtk.ApplicationWindow {
+ internal MyWindow (MyApplication app) {
+ Object (application: app, title: "My Application");
+ }
+}
+
+public class MyApplication : Gtk.Application {
+ protected override void activate () {
+ new MyWindow (this).show ();
+ }
+
+ internal MyApplication () {
+ Object (application_id: "org.example.MyApplication");
+ }
+}
+
+public int main (string[] args) {
+ return new MyApplication ().run (args);
+}
diff --git a/platform-demos/Makefile.am b/platform-demos/Makefile.am
index 0a309ff..416d2bd 100644
--- a/platform-demos/Makefile.am
+++ b/platform-demos/Makefile.am
@@ -32,6 +32,7 @@ DOC_FIGURES = \
media/opensuse.png \
media/grid.png \
media/GtkApplication.png \
+ media/GtkApplicationWindow.png \
media/guitar-tuner.png \
media/guitar-tuner-glade.png \
media/guitar-tuner-pipeline.png \
@@ -67,6 +68,7 @@ DOC_PAGES = \
grid.js.page \
grid.py.page \
GtkApplication.vala.page \
+ GtkApplicationWindow.vala.page \
guitar-tuner.c.page \
guitar-tuner.cpp.page \
guitar-tuner.js.page \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]