ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 8日 (土) 05:22:28 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-txtw-ttags ------------------------- @@ -141,6 +141,11 @@ "background" => "#000000" } ) +You can look up properties you can define on the following link: Gtk::TextTag#Properties. + + +{{br}} + 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})