[gnome-devel-docs] Updated button.js.page to use XIncludes. Also added </list> tag.
- From: Tiffany Antopolski <antopolski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs] Updated button.js.page to use XIncludes. Also added </list> tag.
- Date: Sat, 26 May 2012 16:27:48 +0000 (UTC)
commit 6eee64430db2d7fef94b7868afb92253167de6e4
Author: Tiffany Antopolski <tiffany antopolski gmail com>
Date: Sat May 26 12:23:32 2012 -0400
Updated button.js.page to use XIncludes. Also added </list> tag.
platform-demos/C/button.js.page | 34 +++-------------------------------
1 files changed, 3 insertions(+), 31 deletions(-)
---
diff --git a/platform-demos/C/button.js.page b/platform-demos/C/button.js.page
index c57639a..f9c054f 100644
--- a/platform-demos/C/button.js.page
+++ b/platform-demos/C/button.js.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.js">
<info>
@@ -18,38 +19,8 @@
<media type="image" mime="image/png" src="media/button.png"/>
<p>A button widget that changes its label when you click it.</p>
- <code mime="text/javascript" style="numbered"><![CDATA[
-]]>#!/usr/bin/gjs
+<code mime="text/javascript" style="numbered"><xi:include href="samples/button.js" parse="text"><xi:fallback/></xi:include></code>
-// Initialize GTK
-var Gtk = imports.gi.Gtk;
-Gtk.init(null, 0);
-
-// Create and set up the window
-var buttonWindow = new Gtk.Window({type: Gtk.WindowType.TOPLEVEL});
-buttonWindow.title = "GNOME Button";
-buttonWindow.set_default_size (250,50);
-buttonWindow.connect("destroy", function(){Gtk.main_quit()});
-
-// Create the button and add it to the window
-var theButton = new Gtk.Button ({label: "Click me"});
-buttonWindow.add (theButton);
-
-/* Say what to do when the button is clicked
- You can connect it to more useful things if you like.
- Note that it uses the same syntax as line 11, above.
- Instead of saying what to do when we get a "destroy"
- signal from the window, we're saying what to do when
- we get a "clicked" signal from the button. */
-var clicks = 0;
-theButton.connect ("clicked", function () {
- clicks++;
- this.theButton.set_label("Number of clicks: " + clicks + "!");
-});
-
-// Show the window and the widget inside it, and start the application
-buttonWindow.show_all();
-Gtk.main();</code>
<p>
In this sample we used the following:
</p>
@@ -57,4 +28,5 @@ Gtk.main();</code>
<item><p><link href="http://www.roojs.com/seed/gir-1.2-gtk-3.0/gjs/Gtk.Application.html">Gtk.Application</link></p></item>
<item><p><link href="http://developer.gnome.org/gtk3/stable/GtkApplicationWindow.html">Gtk.ApplicationWindow</link></p></item>
<item><p><link href="http://www.roojs.com/seed/gir-1.2-gtk-3.0/gjs/Gtk.Button.html">Gtk.Button</link></p></item>
+</list>
</page>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]