[gnome-devel-docs] Vala LinkButton sample code and Mallard page.
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] Vala LinkButton sample code and Mallard page.
- Date: Thu, 7 Jun 2012 04:00:14 +0000 (UTC)
commit c212e2ea6dc491746016c86d33ce1ecef3ec51b5
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Wed Jun 6 23:56:50 2012 -0400
Vala LinkButton sample code and Mallard page.
Added a "seealso" link to aboutdialog page, as this is the
obvious use case. Also added both files to Makefile.am
platform-demos/C/aboutdialog.vala.page | 1 +
platform-demos/C/linkbutton.vala.page | 30 ++++++++++++++++++++++++++++++
platform-demos/C/samples/linkbutton.vala | 21 +++++++++++++++++++++
platform-demos/Makefile.am | 2 ++
4 files changed, 54 insertions(+), 0 deletions(-)
---
diff --git a/platform-demos/C/aboutdialog.vala.page b/platform-demos/C/aboutdialog.vala.page
index 99d3798..8849f29 100644
--- a/platform-demos/C/aboutdialog.vala.page
+++ b/platform-demos/C/aboutdialog.vala.page
@@ -6,6 +6,7 @@
<info>
<link type="guide" xref="beginner.vala#windows"/>
<link type="seealso" xref="button.vala"/>
+ <link type="seealso" xref="linkbutton.vala"/>
<revision version="0.1" date="2012-04-07" status="stub"/>
<credit type="author copyright">
diff --git a/platform-demos/C/linkbutton.vala.page b/platform-demos/C/linkbutton.vala.page
new file mode 100644
index 0000000..7b9e213
--- /dev/null
+++ b/platform-demos/C/linkbutton.vala.page
@@ -0,0 +1,30 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<page xmlns="http://projectmallard.org/1.0/"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ type="guide" style="task"
+ id="linkbutton.vala">
+ <info>
+ <link type="guide" xref="beginner.vala#buttons"/>
+ <revision version="0.1" date="2012-06-06" status="draft"/>
+
+ <credit type="author copyright">
+ <name>Tiffany Antopolski</name>
+ <email>tiffany antopolski gmail com</email>
+ <years>2012</years>
+ </credit>
+
+ <desc>Create buttons bound to a URL</desc>
+ </info>
+
+ <title>LinkButton widget</title>
+ <media type="image" mime="image/png" src="media/linkbutton.png"/>
+ <p>This button links to GNOME live.</p>
+
+<code mime="text/x-vala" style="numbered"><xi:include href="samples/linkbutton.vala" parse="text"><xi:fallback/></xi:include></code>
+<p>
+ In this sample we used the following:
+</p>
+<list>
+ <item><p><link href="http://www.valadoc.org/gtk+-3.0/Gtk.LinkButton.html">Gtk.LinkButton</link></p></item>
+</list>
+</page>
diff --git a/platform-demos/C/samples/linkbutton.vala b/platform-demos/C/samples/linkbutton.vala
new file mode 100644
index 0000000..02347af
--- /dev/null
+++ b/platform-demos/C/samples/linkbutton.vala
@@ -0,0 +1,21 @@
+/* This is the application. */
+public class MyApplication : Gtk.Application {
+ /* Override the 'activate' signal of GLib.Application. */
+ protected override void activate () {
+
+ /* Create the window of this application and child widget and show all the things. */
+ var window = new Gtk.ApplicationWindow (this);
+ window.set_default_size (250, 50);
+ window.title = "GNOME LinkButton";
+
+ var linkbutton = new Gtk.LinkButton.with_label ("http://live.gnome.org", "Link to GNOME live!");
+
+ window.add (linkbutton);
+ window.show_all ();
+ }
+}
+
+/* main creates and runs the application. */
+public int main (string[] args) {
+ return new MyApplication ().run (args);
+}
diff --git a/platform-demos/Makefile.am b/platform-demos/Makefile.am
index eee5759..106eb36 100644
--- a/platform-demos/Makefile.am
+++ b/platform-demos/Makefile.am
@@ -63,6 +63,7 @@ demo_sources = \
samples/linkbutton.c \
samples/linkbutton.js \
samples/linkbutton.py \
+ samples/linkbutton.vala \
samples/messagedialog.js \
samples/messagedialog.py \
samples/messagedialog.vala \
@@ -214,6 +215,7 @@ DOC_PAGES = \
linkbutton.c.page \
linkbutton.js.page \
linkbutton.py.page \
+ linkbutton.vala.page \
magic-mirror.vala.page \
message-board.c.page \
messagedialog.js.page \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]