[gnome-devel-docs] tutorials python: a better way to show how to create a radiobutton



commit b6a338237457c1fb0376e0ce4c924d1ae7312786
Author: Marta Maria Casetti <mmcasetti gmail com>
Date:   Fri May 25 08:20:01 2012 +0100

    tutorials python: a better way to show how to create a radiobutton

 platform-demos/C/samples/radiobutton.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/platform-demos/C/samples/radiobutton.py b/platform-demos/C/samples/radiobutton.py
index 0c21793..bf98900 100644
--- a/platform-demos/C/samples/radiobutton.py
+++ b/platform-demos/C/samples/radiobutton.py
@@ -10,8 +10,7 @@ class MyWindow(Gtk.ApplicationWindow):
         self.set_border_width(20)
 
         # a new checkbutton with a label, connected with the callback
-        button1 = Gtk.RadioButton.new(None)
-        button1.set_label("Button 1")
+        button1 = Gtk.RadioButton(label="Button 1")
         button1.connect("toggled", self.toggled_cb)
 
         # another way to create a button - in the same group as button1
@@ -25,7 +24,7 @@ class MyWindow(Gtk.ApplicationWindow):
         button3.connect("toggled", self.toggled_cb)
         button3.set_active(False)
 
-        # DO NOT use new_with_label, it gives a segmentation fault
+        # DO NOT use new_with_label, it gives a segmentation fault!
 
         # a grid to place the buttons
         grid = Gtk.Grid.new()



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