[gnome-devel-docs] python sample: GtkWindow using GtkApplication
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] python sample: GtkWindow using GtkApplication
- Date: Mon, 23 Apr 2012 04:35:12 +0000 (UTC)
commit 8add177bc09141401b06b1c232ed94108ddd648c
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Mon Apr 23 00:32:50 2012 -0400
python sample: GtkWindow using GtkApplication
platform-demos/C/media/window.png | Bin 4707 -> 5440 bytes
platform-demos/C/samples/window.py | 10 +++++++++
platform-demos/C/window.py.page | 40 ++++++++++++++++++++++++++++++++++++
platform-demos/Makefile.am | 1 +
4 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/platform-demos/C/media/window.png b/platform-demos/C/media/window.png
index 773905d..03c4b71 100644
Binary files a/platform-demos/C/media/window.png and b/platform-demos/C/media/window.png differ
diff --git a/platform-demos/C/samples/window.py b/platform-demos/C/samples/window.py
new file mode 100644
index 0000000..3011de1
--- /dev/null
+++ b/platform-demos/C/samples/window.py
@@ -0,0 +1,10 @@
+from gi.repository import Gtk
+import sys
+
+class MyApp(Gtk.Application):
+ def do_activate(self):
+ window = Gtk.Window(application = self)
+ window.set_title("Welcome to GNOME")
+ window.show_all()
+
+MyApp(application_id = "org.example.whatever").run(sys.argv)
diff --git a/platform-demos/C/window.py.page b/platform-demos/C/window.py.page
new file mode 100644
index 0000000..8a5d57f
--- /dev/null
+++ b/platform-demos/C/window.py.page
@@ -0,0 +1,40 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ type="guide" style="task"
+ id="window.py">
+ <info>
+ <link type="guide" xref="beginner.py#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>A toplevel window which can contain other widgets</desc>
+ </info>
+
+ <title>Generic widget</title>
+ <media type="image" mime="image/png" src="media/window.png"/>
+ <p>A minimal Gtk+ Application.</p>
+
+ <code mime="text/x-python" style="numbered"><![CDATA[
+from gi.repository import Gtk
+import sys
+
+class MyApp(Gtk.Application):
+ def do_activate(self):
+ window = Gtk.Window(application = self)
+ window.set_title("Welcome to GNOME")
+ window.show_all()
+
+MyApp(application_id = "org.example.whatever").run(sys.argv)
+]]></code>
+<p>
+ In this sample we used the following:
+</p>
+<list>
+ <item><p><link href="http://developer.gnome.org/gtk3/3.4/GtkApplication.html">Gtk.Application</link></p></item>
+ <item><p><link href="http://developer.gnome.org/gtk3/3.4/GtkWindow.html">Gtk.Window</link></p></item>
+</list>
+</page>
diff --git a/platform-demos/Makefile.am b/platform-demos/Makefile.am
index 93a65db..b81a87b 100644
--- a/platform-demos/Makefile.am
+++ b/platform-demos/Makefile.am
@@ -92,6 +92,7 @@ DOC_PAGES = \
weatherAutotools.js.page \
weatherGeonames.js.page \
window.js.page \
+ window.py.page \
window.vala.page
dist-hook: doc-dist-hook
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]