ruby-****@sourc*****
ruby-****@sourc*****
2009年 2月 7日 (土) 07:13:46 JST
------------------------- REMOTE_ADDR = 74.15.84.244 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-txtw-ttags ------------------------- @@ -147,7 +147,7 @@ ... buff.apply_tag("bold", start_iter, end_iter) -NOTE: in our example program we used a trick to obtain tag property names from button labels, where they are stored as Gtk::Stock items. If you need to store some new property such as a tag value in your widgets you could simply add it to the widget class as needed. For instance you could expand the Gtk::Button class to include a new property called ((*texttag*)). +NOTE: in our example program we used a trick to obtain tag property names from button labels, where they are stored as Gtk::Stock items. If you need to store some new property such as a tag value in your widgets you could simply add it to the widget class as needed. For instance you could expand the Gtk::Button class to include a new property called ((*texttag.*)) Just as a picture is worth a thousand words so is perhaps a listing of an executable program. Let me repeat the above example program this time with code that modifies Gtk::Button class to include a new property to store a tag_name, used in Gtk::TextBuffer's tag table: