[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-treev-crs

Zurück zum Archiv-Index

ruby-****@sourc***** ruby-****@sourc*****
2012年 10月 8日 (月) 02:36:25 JST


-------------------------
REMOTE_ADDR = 184.145.80.187
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-crs
-------------------------
@@ -156,11 +156,17 @@
  window.show_all
  Gtk.main
 
+Toggle cell renderers are created with Gtk::CellRendererToggle.new. Next, note that this time the((*active*))property is added as a column attribute rather than((*text,*))as used by the Gtk::CellRendererText:
 
-Toggle cell renderers are created with Gtk::CellRendererToggle.new. After they are created you need to need to set its ((*activatable*)) property to true, so that it can be toggled, otherwise user will not be able to check the check box. This is useful if you only wish to use the check boxes as a more convenient display feature than is string TRUE or FALSE.
+ column = Gtk::TreeViewColumn.new("Buy", renderer, "active" => GItm::BUY_INDEX)
 
-Next, the ((*activate*)) property should be added as a column attribute instead of ((*text*)), which was the case with Gtk::CellRendererText:
+You also must bind the Gtk::CellRendererToggle renderer object to((*'toggled'*))signal and connect it to the callback code block. The block receives the cell renderer and Gtk::TreePath string pointing to the row containing the toggle button.
 
- column = Gtk::TreeViewColumn.new("Buy", renderer, "active" => GItm::BUY_INDEX)
+If you wish to turn the check box toggle button into radio button you can accomplish this by setting the renderer's radio property to true:
+
+ renderer.radio = true
+ 
+But if you do that, you will still have to implement the radio button functionality yourself, otherwise you are risking to confuse your users with inconsistent behaviour of your radio buttons.
+
 
-You also must bind the Gtk::CellRendererToggle renderer object to ((*'toggled'*)) signal and connect it to the callback proc (block). The block receives the cell renderer and Gtk::TreePath string pointing to the row containing the toggle button.
+=== Toggle Button Renderers May Effect Other Related Values In Tree View




ruby-gnome2-cvs メーリングリストの案内
Zurück zum Archiv-Index