ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 3日 (月) 05:35:37 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-txtw-textview ------------------------- @@ -218,8 +218,9 @@ window.show_all Gtk.main -The Gtk::PangoLayout object is used to represent a whole paragraph of text. Normally, Pango uses it internally for laying out text within a widget. However, it can be employed as in our example in the ((*make_tab_array*)) function to calculate the width of the tab string. Note that using tab, let alone changing it makes sense only when you have a mono-spaced text as well when you use the same font through out the text. +The Pango::Layout object is used to represent a whole paragraph of text. Normally, Pango uses it internally for laying out text within a widget. However, it can be employed as in our example in the ((*make_tab_array*)) function to calculate the width of the tab string. Note that using tab, let alone changing it makes sense only when you have a mono-spaced text as well when you use the same font through out the text. +In ((*make_tab_array*))method we use Pango::Layout object and a set of other Pango devices to set up our ((*TAB.*))We start up with Gtk::Widget#create_pango_layout(text=nil). In general Pango::Layout object is created by Pango::Layout.new, which creates a new Pango::Layout object with attributes initialized to default values for a particular Pango::Context. However, in our sample program we are employing Gtk::Widget#create_pango_layout instead. API documentation tells us that Gtk::Widget#create_pango_layout(text=nil) creates a new Pango::Layout with the appropriate colormap, font description, and base direction for drawing text for this widget. {{image_right("dialog-warning.png")}} :Warning: