[gnome-devel-docs/beginners: 8/12] GTK+ Python tutorial: page about separator



commit d2bcfee72dd73040ec100aa6a0f1dd49563ce447
Author: Marta Maria Casetti <mmcasetti gmail com>
Date:   Wed Mar 6 08:39:01 2013 +0000

    GTK+ Python tutorial: page about separator
    
    Done.

 beginners-docs/C/grid.py.page         |    7 ++++---
 beginners-docs/C/samples/separator.py |   17 ++++-------------
 beginners-docs/C/separator.py.page    |   28 +++++++++++++++++++++-------
 3 files changed, 29 insertions(+), 23 deletions(-)
---
diff --git a/beginners-docs/C/grid.py.page b/beginners-docs/C/grid.py.page
index 606895c..c04f76d 100644
--- a/beginners-docs/C/grid.py.page
+++ b/beginners-docs/C/grid.py.page
@@ -49,8 +49,8 @@
   <title>A more in-depth look</title>
 
   <p>We create the grid inside the window (line 13), then we attach the widgets 
-  to the grid (lines 16&#8211;18), and finally we attach the grid to the window 
-  (line 20).</p>
+  (called children of the grid and therefore siblings of each other) to the grid 
+  (lines 16&#8211;18), and finally we attach the grid to the window (line 20).</p>
   
   <p>To attach a widget <code><var>child</var></code> in position 
   <code><var>left</var>, <var>top</var></code> in a slot of given 
@@ -91,7 +91,8 @@
 
   <p>Insert a column between the two labels in the first row.</p>
 
-  <p>Write another example on the model of the one you have seen above.</p>
+  <p>Write another example on the model of the one you have seen above. Make it 
+  bigger! Add labels and images!</p>
 
   </section>
   
diff --git a/beginners-docs/C/samples/separator.py b/beginners-docs/C/samples/separator.py
index 4263a27..fede4dc 100644
--- a/beginners-docs/C/samples/separator.py
+++ b/beginners-docs/C/samples/separator.py
@@ -5,22 +5,13 @@ class MyWindow(Gtk.ApplicationWindow):
     def __init__(self, app):
         Gtk.Window.__init__(self, title="Separator Example", application=app)
 
-        # three labels
-        label1 = Gtk.Label()
-        label1.set_text("Below, a horizontal separator.")
+        label1 = Gtk.Label(label="Below, a horizontal separator.")
+        label2 = Gtk.Label(label="On the right, a vertical separator.")
+        label3 = Gtk.Label(label="On the left, a vertical separator.")
 
-        label2 = Gtk.Label()
-        label2.set_text("On the right, a vertical separator.")
-
-        label3 = Gtk.Label()
-        label3.set_text("On the left, a vertical separator.")
-
-        # a horizontal separator
         hseparator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
-        # a vertical separator
         vseparator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)
 
-        # a grid to attach labels and separators
         grid = Gtk.Grid()
         grid.attach(label1, 0, 0, 3, 1)
         grid.attach(hseparator, 0, 1, 3, 1)
@@ -28,7 +19,7 @@ class MyWindow(Gtk.ApplicationWindow):
         grid.attach(vseparator, 1, 2, 1, 1)
         grid.attach(label3, 2, 2, 1, 1)
         grid.set_column_homogeneous(True)
-        # add the grid to the window
+
         self.add(grid)
 
 class MyApplication(Gtk.Application):
diff --git a/beginners-docs/C/separator.py.page b/beginners-docs/C/separator.py.page
index 05f10a1..fd2e01b 100644
--- a/beginners-docs/C/separator.py.page
+++ b/beginners-docs/C/separator.py.page
@@ -5,7 +5,6 @@
       id="separator.py">
   <info>
     <title type="text">Seperator (Python)</title>
-    <link type="guide" xref="beginner.py#ornaments"/>
     <link type="seealso" xref="grid.py"/>
     <link type="next" xref="scrolledwindow.py" />
     <revision version="0.1" date="2012-06-01" status="draft"/>
@@ -16,19 +15,34 @@
       <years>2012</years>
     </credit>
 
-    <desc>A separator widget</desc>
+    <desc>A separator widget to decorate the window</desc>
   </info>
 
   <title>Separator</title>
 
-  <media type="image" mime="image/png" src="media/separator.png"/>
-  <p>A horizontal and a vertical separator divide some labels.</p>
+  <synopsis><p>We can decorate the window with a separator - a horizontal or 
+  vertical line that attached to a grid separates the cells.</p></synopsis>
 
   <links type="section"/>
 
-  <section id="code">
-    <title>Code used to generate this example</title>
-    <code mime="text/x-python" style="numbered"><xi:include href="samples/separator.py" 
parse="text"><xi:fallback/></xi:include></code>
+  <section id="example">
+  <title>An example</title>
+
+  <p>An example of window with a grid in which we insert two separators</p>
+
+  <media type="image" mime="image/png" src="media/separator.png"/>
+
+  <p>The code used to generate this example is as below.</p>
+
+  <code mime="text/x-python" style="numbered"><xi:include href="samples/separator.py" 
parse="text"><xi:fallback/></xi:include></code>
+  </section>
+  
+  <section id="exercises">
+  <title>Exercises</title>
+  
+  <p>Add some separators to the example you constructed for 
+  <link xref="grid.py"/></p>
+  
   </section>
 
   <section id="reference">


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