[gnome-devel-docs] tutorials python: pages on properties and signals edited



commit dd7270050bee6ba92dbfcae62a4216a9fb91179c
Author: Marta Maria Casetti <mmcasetti gmail com>
Date:   Sat Jul 14 15:34:41 2012 +0100

    tutorials python: pages on properties and signals edited

 platform-demos/C/properties.py.page        |   12 ++++++++++++
 platform-demos/C/signals-callbacks.py.page |   21 +++++++++++++++++----
 2 files changed, 29 insertions(+), 4 deletions(-)
---
diff --git a/platform-demos/C/properties.py.page b/platform-demos/C/properties.py.page
index b3301fb..69a3aa7 100644
--- a/platform-demos/C/properties.py.page
+++ b/platform-demos/C/properties.py.page
@@ -23,6 +23,11 @@
 
 <title>Properties</title>
 
+<links type="section" />
+
+<section id="overview">
+<title>Overview</title>
+
 <p><em>Properties</em> describe the configuration and state of widgets, and each widget has its own particular set of properties. For example, a widget such as a button or a label has the property "label" which contains the text of the widget. You can specify the name and value of any number of properties as keyword arguments when creating an instance of a widget: for example, to create a label aligned to the right with the text âHello Worldâ and an angle of 25 degrees, you can use:</p>
 <code>
 label = Gtk.Label(label="Hello World", angle=25, halign=Gtk.Align.END)</code>
@@ -36,4 +41,11 @@ label.set_halign(Gtk.Align.END)</code>
 
 <p>Once you have created such a label, you can get the text with the getter <code>label.get_label()</code>. Instead of using getters and setters you can also get and set the properties with <code>widget.get_property("prop-name")</code> and <code>widget.set_property("prop-name", value)</code>, respectively.</p>
 
+</section>
+<section id="references">
+<title>References</title>
+
+<p><link href="http://python-gtk-3-tutorial.readthedocs.org/en/latest/basics.html";>Basics - Properties</link> in Python Gtk+ 3 Tutorial</p>
+</section>
+
 </page>
diff --git a/platform-demos/C/signals-callbacks.py.page b/platform-demos/C/signals-callbacks.py.page
index 929121e..cb91fb3 100644
--- a/platform-demos/C/signals-callbacks.py.page
+++ b/platform-demos/C/signals-callbacks.py.page
@@ -23,14 +23,27 @@
 
 <title>Signals and callbacks</title>
 
-<p>Like most GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ sits in the main loop and waits for input. If the user performs some action - say, a mouse click - then the main loop &#34;wakes up&#34; and delivers an event to GTK+.</p>
+<links type="section" />
 
-<p>When widgets receive an event, they frequently emit one or more signals. Signals notify your program that &#34;something interesting happened&#34; by invoking functions you have connected to the signal. Such functions are commonly known as callbacks. When your callbacks are invoked, you would typically take some action. After a callback finishes, GTK+ will return to the main loop and await more user input.</p>
+<section id="overview">
+<title>Overview</title>
 
-<p>A generic example is: <code>handler_id = widget.connect("event", callback, data)</code>.</p>
+<p>Like most GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ sits in the main loop and waits for input. If the user performs some action - say, a mouse click - then the main loop "wakes up" and delivers an event to GTK+.</p>
 
-<p>Firstly, <code>widget</code> is an instance of a widget we created earlier. Next, the event we are interested in. Each widget has its own particular events which can occur. For instance, if you have a Gtk.Button you usually want to connect to the &#34;clicked&#34; event. This means that when the button is clicked, the signal is issued. Thirdly, the callback argument is the name of the callback function. It contains the code which runs when signals of the specified type are issued. Finally, the data argument includes any data which should be passed when the signal is issued. However, this argument is completely optional and can be left out if not required.</p>
+<p>When widgets receive an event, they frequently emit one or more signals. Signals notify your program that "something interesting happened" by invoking functions you have connected to the signal. Such functions are commonly known as callbacks. When your callbacks are invoked, you would typically take some action. After a callback finishes, GTK+ will return to the main loop and await more user input.</p>
+
+<p>A generic example is: <code>handler_id = widget.connect("event", callback, data)</code>. <code>widget</code> is an instance of a widget we created earlier. Next, the <code>event</code> we are interested in. Each widget has its own particular events which can occur. For instance, if you have a Gtk.Button you usually want to connect to the "clicked" event: this means that when the button is clicked, the signal is issued. Another example is the <code>notify::property</code> signal: whenever a <link xref="properties.py">property</link> is modified on a GObject, instead of just emitting the <code>notify</code> signal, GObject associates as a detail to this signal emission the name of the property modified. This allows clients who wish to be notified of changes to only one property to filter most events before receiving them. Thirdly, the callback argument is the name of the callback function, which contains the code which runs when signals of the specified type are issued. Fin
 ally, the optional data argument includes any data which should be passed when the signal is issued.</p>
 
 <p>The function returns a number (the <code>handler_id</code>) that identifies this particular signal-callback pair. This number is required to disconnect from a signal such that the callback function will not be called during any future or currently ongoing emissions of the signal it has been connected to, as in <code>widget.disconnect(handler_id)</code>.</p>
 
+</section>
+
+<section id="references">
+
+<title>References</title>
+<p><link href="http://developer.gnome.org/gobject/stable/signal.html";>Signals</link> in GObject documentation</p>
+<p><link href="http://python-gtk-3-tutorial.readthedocs.org/en/latest/basics.html";>Basics - Main loop and Signals</link> in Python Gtk+ 3 Tutorial</p>
+</section>
+
+
 </page>



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