ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 14日 (金) 07:08:22 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-txtw-scrolledwin ------------------------- @@ -159,7 +159,7 @@ In our example the adjustments are used when viewport is created with Gtk::Viewport.new(horizontal, vertical). The viewport adjustments are initialized with those from the scrolled window, ensuring that both containers will be scrolled at the same time. -One additional decision you often would like to make when setting up a scrolled window is to specify when the scrollbars will be visible. This is accomplished with Gtk::ScrolledWindow#set_policy(hscrollbar_policy, vscrollbar_policy). The policy arguments, take one of the values defined in ((<GtkPolicyType|Gtk#GtkPolicyType>)). Though unlikely, another thing you may wish to set is the placement of the scrollbars. For that you have Gtk::Scrollbar#window_placement=(window_placement) method at your disposal. Look for the correct argument values at ((<GtkCornerType|Gtk#GtkCornerType>)). +One additional decision you often would like to make when setting up a scrolled window is to specify when the scrollbars will be visible. This is accomplished with Gtk::ScrolledWindow#set_policy(hscrollbar_policy, vscrollbar_policy). The policy arguments take one of the values defined in ((<GtkPolicyType|Gtk#GtkPolicyType>)). Though unlikely, another thing you may wish to set is the placement of the scrollbars. For that you have Gtk::Scrollbar#window_placement=(window_placement) method at your disposal. Look for the correct argument values at ((<GtkCornerType|Gtk#GtkCornerType>)). After you have setup a scrolled window you should add a child widget which you intend to slide around with your scrollbars. There are two possible ways of doing this, and the method is chosen based on the type of child widget. If you are adding to your scrolling window a Gtk::TextView, Gtk::TreeView, Gtk::IconView, or Gtk::Layout widget you should use Gtk::Container#add method, since all five of these containers include native scrolling support.