[gnome-devel-docs] Vala sample: added samples/button.vala as XInclude



commit 22e24c447959a44f29e0ac8601b7283f638b04c7
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date:   Sat Apr 28 00:46:24 2012 -0400

    Vala sample: added samples/button.vala as XInclude
    
     - Also added the file to the Makefile.am

 platform-demos/C/button.vala.page |   38 +++---------------------------------
 platform-demos/Makefile.am        |    1 +
 2 files changed, 5 insertions(+), 34 deletions(-)
---
diff --git a/platform-demos/C/button.vala.page b/platform-demos/C/button.vala.page
index 6bfa131..b95786e 100644
--- a/platform-demos/C/button.vala.page
+++ b/platform-demos/C/button.vala.page
@@ -1,4 +1,5 @@
 <page xmlns="http://projectmallard.org/1.0/";
+      xmlns:xi="http://www.w3.org/2001/XInclude";
       type="guide" style="task"
       id="button.vala">
   <info>
@@ -19,40 +20,9 @@
   <media type="image" mime="image/png" src="media/button.png"/>
   <p>A button widget connected to a simple callback function.</p>
 
-      <code mime="text/x-vala" style="numbered"><![CDATA[
-public class MyWindow : Gtk.ApplicationWindow {
-	void reverse_label (Gtk.Button button) {
-		button.label = button.label.reverse ();
-	}
-
-	internal MyWindow (MyApplication app) {
-		Object (application: app, title: "GNOME Button");
-
-		var button = new Gtk.Button.with_label ("Click Me");
-		button.clicked.connect (reverse_label);
-                button.show ();
-
-                this.window_position = Gtk.WindowPosition.CENTER;
-                this.set_default_size (250,50);
-		this.add (button);
-
-	}
-}
-
-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>
+<code mime="text/x-vala" style="numbered">
+<xi:include href="samples/button.vala" parse="text"><xi:fallback/></xi:include>
+</code>
 <p>
   In this sample we used the following:
   <link xref="GtkApplicationWindow.vala">Gtk.ApplicationWindow</link>,
diff --git a/platform-demos/Makefile.am b/platform-demos/Makefile.am
index 5a4bf21..0011046 100644
--- a/platform-demos/Makefile.am
+++ b/platform-demos/Makefile.am
@@ -22,6 +22,7 @@ demo_sources = \
 	photo-wall/photo-wall.c 		\		
 	record-collection/record-collection.js 	\
 	samples/aboutdialog_GMenu.vala		\
+	samples/button.vala			\
 	samples/dialog.vala			\
 	samples/GtkApplicationWindow.vala	\
 	samples/window.vala			\



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]