[gnome-devel-docs] tutorials python: an annotated version of entry.py



commit 0a377e550bd34db59fb37758b8ebbb1a59e86ef1
Author: Marta Maria Casetti <mmcasetti gmail com>
Date:   Thu May 24 16:49:09 2012 +0100

    tutorials python: an annotated version of entry.py

 platform-demos/C/samples/entry.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/platform-demos/C/samples/entry.py b/platform-demos/C/samples/entry.py
index 6783895..351719f 100644
--- a/platform-demos/C/samples/entry.py
+++ b/platform-demos/C/samples/entry.py
@@ -8,12 +8,14 @@ class MyWindow(Gtk.ApplicationWindow):
         self.set_default_size(300, 100)
         self.set_border_width(10)
 
+        # a single line entry
         name_box = Gtk.Entry()
+        # sends a signal when the Enter key is pressed
         name_box.connect("activate", self.cb_activate)
 
         self.add(name_box)
 
-    # the button operates on the window
+    # the content of the entry is used to write in the terminal
     def cb_activate(self, entry):
 		name = entry.get_text()
 		print "\nHello " + name + "!\n"



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