[gnome-devel-docs] Vala samples: Gtk.Label example
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] Vala samples: Gtk.Label example
- Date: Sat, 28 Apr 2012 23:51:21 +0000 (UTC)
commit a3f39237bae97543aa8b7b77a60024d8ae8bc6bc
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Sat Apr 28 19:50:53 2012 -0400
Vala samples: Gtk.Label example
platform-demos/C/label.vala.page | 33 +++++++++++++++++++++++++++++++++
platform-demos/C/media/label.png | Bin 0 -> 5557 bytes
platform-demos/C/samples/label.vala | 25 +++++++++++++++++++++++++
platform-demos/Makefile.am | 3 +++
4 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/platform-demos/C/label.vala.page b/platform-demos/C/label.vala.page
new file mode 100644
index 0000000..fcaf9c1
--- /dev/null
+++ b/platform-demos/C/label.vala.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="label.vala">
+ <info>
+ <link type="guide" xref="beginner.vala#display-widgets"/>
+ <revision version="0.1" date="2012-04-28" status="review"/>
+
+ <credit type="author copyright">
+ <name>Tiffany Antopolski</name>
+ <email>tiffany antopolski gmail com</email>
+ <years>2012</years>
+ </credit>
+
+ <desc>A widget which displays text</desc>
+ </info>
+
+ <title>Label</title>
+ <media type="image" mime="image/png" src="media/label.png"/>
+ <p>A simple label</p>
+
+<code mime="text/x-vala" style="numbered">
+<xi:include href="samples/label.vala" parse="text"><xi:fallback/></xi:include>
+</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>
+ <item><p><link href="http://www.valadoc.org/#!api=gtk+-3.0/Gtk.Label">Gtk.Label</link></p></item>
+</list>
+</page>
diff --git a/platform-demos/C/media/label.png b/platform-demos/C/media/label.png
new file mode 100644
index 0000000..64814b6
Binary files /dev/null and b/platform-demos/C/media/label.png differ
diff --git a/platform-demos/C/samples/label.vala b/platform-demos/C/samples/label.vala
new file mode 100644
index 0000000..6434771
--- /dev/null
+++ b/platform-demos/C/samples/label.vala
@@ -0,0 +1,25 @@
+public class MyWindow : Gtk.ApplicationWindow {
+ internal MyWindow (MyApplication app) {
+ Object (application: app, title: "Welcome to GNOME");
+
+ var label = new Gtk.Label ("Hello GNOME!");
+
+ this.add (label);
+ this.set_default_size (200, 100);
+ this.show_all ();
+ }
+}
+
+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 0d3ba75..4977bcf 100644
--- a/platform-demos/Makefile.am
+++ b/platform-demos/Makefile.am
@@ -26,6 +26,7 @@ demo_sources = \
samples/dialog.vala \
samples/grid.py \
samples/GtkApplicationWindow.vala \
+ samples/label.vala \
samples/messagedialog.vala \
samples/window.c \
samples/window.py \
@@ -47,6 +48,7 @@ DOC_FIGURES = \
media/guitar-tuner-pipeline.png \
media/helloWorldJs.png \
media/image-viewer.png \
+ media/label.png \
media/magic-mirror.png \
media/message-board.ogv \
media/messagedialog.png \
@@ -94,6 +96,7 @@ DOC_PAGES = \
image-viewer.vala.page \
index.page \
js.page \
+ label.vala.page \
magic-mirror.vala.page \
message-board.c.page \
messagedialog.vala.page \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]