ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 1日 (土) 09:04:10 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-txtw-scrolledwin ------------------------- @@ -90,7 +90,11 @@ window.show_all Gtk.main -The scrolled window is simply a container with scrollbars. Neither the container nor the scrollbars perform any action by themselves. Scrolling is handled by the child widget, which is why the child widget must have a scrolling support. As you know by now, most GTK+ widgets originally do not include such a support - we mentioned only five that do. For all these widgets scrolling behaviour is added with the help of portview. Adjustments are also tightly related to scrolling. When you add a child widget with scrolling support to a scrolled window adjustments for both x and y axis are added. If the child does not have scrolling capabilities nothing will happen, which is why widgets without these capabilities are first added to a viewport. Since viewport does not have any scrollbars the adjustments must be added to it: +The scrolled window is simply a container with scrollbars. Neither the container nor the scrollbars perform any action by themselves. Scrolling is handled by the child widget, which is why the child widget must have a scrolling support. As you know by now, most GTK+ widgets originally do not include such a support - we mentioned only five that do (Gtk::TextView, Gtk::TreeView, Gtk::IconView, or Gtk::Layout). For all these other widgets, without native scrolling support, scrolling behaviour is added with the help of portview. + +Adjustments are tightly related to scrolling. When user clicks and drags a scrollbar, the value in adjustment object changes and causes((*value-changed*))signal to be emitted, which subsequently will cause the child to render itself accordingly. + +When you add a child widget with scrolling support to a scrolled window, adjustments for both x and y axis are added. If the child does not have scrolling capabilities nothing will happen, which is why widgets without these capabilities are first added to a viewport. Since viewport does not have any scrollbars the adjustments must be added to it: viewport = Gtk::Viewport.new(horizontal, vertical)