ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 8日 (土) 23:52:32 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-txtw-ttags ------------------------- @@ -215,6 +215,8 @@ {{br}} +But lets return back to our study ot the((*texttags.rb*))program: + Once you created a tag with its properties you will, later on - most likely in a callback, need to retrieve it from the text buffer's tag table by specifying its tag_name. At the same time you apply it to a segment or portion of the text buffer defined by start and end iterators. In the following snippet of code we create a an entry in tag table for the Gtk::TextBuffer object called buff. We create tag called "bold" and add for it a property name/value pair as hash {"weight" => Pango::WEIGHT_BOLD}. Subsequently (later in the program; in our case in a callback) we extract and apply the property value pair for this tag: buff.create_tag("bold", {"weight" => Pango::WEIGHT_BOLD})