<html> <head><title>Gtk-- Reference: Gtk::ScrolledWindow</title></head> <body bgcolor="#F0F0F0" text="#000000" link="#0000FF" vlink="#000077" alink="#FF0000"> <table align=center border=0 cellspacing=10> <tr> <td><a href="class_index.html">Class Index</a></td> <td><a href="cross_index.html">Cross Index</a></td> <td><a href="name_index.html">Namespace Index</a></td> </table> <h1 align=center>Class Gtk::ScrolledWindow</h1><p> <b> Adds scrollbars to its child widget.</b><br> Contained in: <a href="Gtk.html">Gtk</a><br> Derived from: <a href="Gtk%3A%3ABin.html">Gtk::Bin</a> <br> Derived by: <i>none</i> <p> #include <gtk--/scrolledwindow.h> <p> <hr noshade> <table border=0> <tr><td colspan=3><h3>public function member index:</h3></td> <tr valign=top><td align=right><tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2672"><tt><font color=blue><b>ScrolledWindow</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>& <tt><font color=blue>hadjustment</font></tt>, <a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>& <tt><font color=blue>vadjustment</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2673"><tt><font color=blue><b>ScrolledWindow</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2685"><tt><font color=blue><b>add_with_viewport</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AWidget.html"><tt><font color=navy><b>Widget</b></font></tt></a>& <tt><font color=blue>child</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2678"><tt><font color=blue><b>get_hadjustment</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AHScrollbar.html"><tt><font color=navy><b>HScrollbar</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2688"><tt><font color=blue><b>get_hscrollbar</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkPolicyType</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2680"><tt><font color=blue><b>get_hscrollbar_policy</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2687"><tt><font color=blue><b>get_hscrollbar_visible</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkCornerType</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2683"><tt><font color=blue><b>get_placement</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2679"><tt><font color=blue><b>get_vadjustment</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AVScrollbar.html"><tt><font color=navy><b>VScrollbar</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2689"><tt><font color=blue><b>get_vscrollbar</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkPolicyType</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2681"><tt><font color=blue><b>get_vscrollbar_policy</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2686"><tt><font color=blue><b>get_vscrollbar_visible</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkScrolledWindow</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2668"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>const</tt> <tt><font color=navy>GtkScrolledWindow</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2669"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2670"><tt><font color=blue><b>isA</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2674"><tt><font color=blue><b>set_hadjustment</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>* <tt><font color=blue>hadjustment</font></tt>=0)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2676"><tt><font color=blue><b>set_hadjustment</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>& <tt><font color=blue>hadjustment</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2684"><tt><font color=blue><b>set_placement</b></font></tt></a></td><td><tt>(<tt><font color=navy>GtkCornerType</font></tt> <tt><font color=blue>window_placement</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2682"><tt><font color=blue><b>set_policy</b></font></tt></a></td><td><tt>(<tt><font color=navy>GtkPolicyType</font></tt> <tt><font color=blue>hscrollbar_policy</font></tt>, <tt><font color=navy>GtkPolicyType</font></tt> <tt><font color=blue>vscrollbar_policy</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2675"><tt><font color=blue><b>set_vadjustment</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>* <tt><font color=blue>vadjustment</font></tt>=0)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2677"><tt><font color=blue><b>set_vadjustment</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>& <tt><font color=blue>vadjustment</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="Gtk%3A%3AScrolledWindow.html#2671"><tt><font color=blue><b>~ScrolledWindow</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> <tt><font color=navy><b>Gtk::ScrolledWindow</b></font></tt> is a <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3ABin.html"><tt><font color=navy><b>Bin</b></font></tt></a></tt> subclass: it's a container that accepts a single child widget. <tt><font color=navy><b>Gtk::ScrolledWindow</b></font></tt> adds scrollbars to the child widget. <P> The scrolled window can work in two ways. Some widgets have native scrolling support; these widgets have <i>slots</i> for <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt> objects. The scrolled window installs <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt> objects in the child window's slots using the set_scroll_adjustments_signal, found in the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AWidget.html"><tt><font color=navy><b>Widget</b></font></tt></a></tt> Class. (This is how it works in GTK+, not sure about GTK--). <P> The second way to use the scrolled window is useful with widgets that lack the set_scroll_adjustments_signal. The <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AViewport.html"><tt><font color=navy><b>Viewport</b></font></tt></a></tt> widget acts as a proxy, implementing scrollability for child widgets that lack their own scrolling capabilities. <P> If a widget has native scrolling abilities, it can be added to the <tt><font color=navy><b>Gtk::ScrolledWindow</b></font></tt> with <a href="Gtk%3A%3AContainer.html#989"><tt><font color=blue><b>add</b></font></tt></a>. If a widget does not, you must first add the widget to a <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AViewport.html"><tt><font color=navy><b>Viewport</b></font></tt></a></tt>, then add the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AViewport.html"><tt><font color=navy><b>Viewport</b></font></tt></a></tt> to the scrolled window. The convenience function <a href="Gtk%3A%3AScrolledWindow.html#2685"><tt><font color=blue><b>add_with_viewport</b></font></tt></a> does exactly this, so you can ignore the presence of the viewport.<br> <p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="2685"><font size=+1><b>Gtk::ScrolledWindow::add_with_viewport</b></font></a> - Used to add children without native scrolling capabilities.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2685"><tt><font color=blue><b>add_with_viewport</b></font></tt></a><tt>(<a href="Gtk%3A%3AWidget.html"><tt><font color=navy><b>Widget</b></font></tt></a>& <tt><font color=blue>child</font></tt>)</tt>;<br><blockquote> This is simply a convenience function; it is equivalent to adding the unscrollable child to a viewport, then adding the viewport to the scrolled window. If a child has native scrolling, use <a href="Gtk%3A%3AContainer.html#989"><tt><font color=blue><b>add</b></font></tt></a> instead of this function. <P> The viewport scrolls the child by moving its <tt><tt><font color=navy><b>Gdk::Window</b></font></tt></tt>, and takes the size of the child to be the size of its toplevel <tt><tt><font color=navy><b>Gdk::Window</b></font></tt></tt>. This will be very wrong for most widgets that support native scrolling; for example, if you add a <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3ACList.html"><tt><font color=navy><b>CList</b></font></tt></a></tt> with a viewport, the whole widget will scroll, including the column headings. Thus <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3ACList.html"><tt><font color=navy><b>CList</b></font></tt></a></tt> supports scrolling already, and should not be used with the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AViewport.html"><tt><font color=navy><b>Viewport</b></font></tt></a></tt> proxy. <tt><font color=blue>child</font></tt>: Widget you want to scroll.</blockquote> <br><br> <a name="2678"><font size=+1><b>Gtk::ScrolledWindow::get_hadjustment</b></font></a> - Returns the horizontal scrollbar's adjustment, used to connect the horizontal scrollbar to the child widget's horizontal scroll functionality.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>*</tt> <a href="Gtk%3A%3AScrolledWindow.html#2678"><tt><font color=blue><b>get_hadjustment</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> <tt><font color=blue>Returns</font></tt>: The horizontal <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt>.</blockquote> <br><br> <a name="2679"><font size=+1><b>Gtk::ScrolledWindow::get_vadjustment</b></font></a> - Returns the vertical scrollbar's adjustment, used to connect the vertical scrollbar to the child widget's vertical scroll functionality.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>*</tt> <a href="Gtk%3A%3AScrolledWindow.html#2679"><tt><font color=blue><b>get_vadjustment</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> <tt><font color=blue>Returns</font></tt>: The vertical <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt>.</blockquote> <br><br> <a name="2668"><font size=+1><b>Gtk::ScrolledWindow::gtkobj</b></font></a> - Returns the underlaying gtk+ object.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>GtkScrolledWindow</font></tt>*</tt> <a href="Gtk%3A%3AScrolledWindow.html#2668"><tt><font color=blue><b>gtkobj</b></font></tt></a><tt>()</tt>;<br><br> <a name="2670"><font size=+1><b>Gtk::ScrolledWindow::isA</b></font></a> - Returns true if object is this type.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2670"><tt><font color=blue><b>isA</b></font></tt></a><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;<br><br> <a name="2674"><font size=+1><b>Gtk::ScrolledWindow::set_hadjustment</b></font></a> - Sets the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt> for the horizontal scrollbar.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2674"><tt><font color=blue><b>set_hadjustment</b></font></tt></a><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>* <tt><font color=blue>hadjustment</font></tt>=0)</tt>;<br><blockquote> <tt><font color=blue>hadjustment</font></tt>: Horizontal scroll adjustment.</blockquote> <br><br> <a name="2676"><font size=+1><b>Gtk::ScrolledWindow::set_hadjustment</b></font></a> - Sets the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt> for the horizontal scrollbar.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2676"><tt><font color=blue><b>set_hadjustment</b></font></tt></a><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>& <tt><font color=blue>hadjustment</font></tt>)</tt>;<br><blockquote> <tt><font color=blue>hadjustment</font></tt>: Horizontal scroll adjustment.</blockquote> <br><br> <a name="2684"><font size=+1><b>Gtk::ScrolledWindow::set_placement</b></font></a> - Determines the location of the child widget with respect to the scrollbars.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2684"><tt><font color=blue><b>set_placement</b></font></tt></a><tt>(<tt><font color=navy>GtkCornerType</font></tt> <tt><font color=blue>window_placement</font></tt>)</tt>;<br><blockquote> The default is <tt><font color=green>GTK_CORNER_TOP_LEFT</font></tt>, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in <tt><font color=navy>GtkCornerType</font></tt> are <tt><font color=green>GTK_CORNER_TOP_RIGHT</font></tt>, <tt><font color=green>GTK_CORNER_BOTTOM_LEFT</font></tt>, and <tt><font color=green>GTK_CORNER_BOTTOM_RIGHT</font></tt>. <tt><font color=blue>window_placement</font></tt>: Position of the child window.</blockquote> <br><br> <a name="2682"><font size=+1><b>Gtk::ScrolledWindow::set_policy</b></font></a> - Sets the scrollbar policy for the horizontal and vertical scrollbars.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2682"><tt><font color=blue><b>set_policy</b></font></tt></a><tt>(<tt><font color=navy>GtkPolicyType</font></tt> <tt><font color=blue>hscrollbar_policy</font></tt>, <tt><font color=navy>GtkPolicyType</font></tt> <tt><font color=blue>vscrollbar_policy</font></tt>)</tt>;<br><blockquote> The policy determines when the scrollbar should appear; it is a value from the <tt><font color=navy>GtkPolicyType</font></tt> enumeration. If <tt><font color=green>GTK_POLICY_ALWAYS</font></tt>, the scrollbar is always present. If <tt><font color=green>GTK_POLICY_NEVER</font></tt>, the scrollbar is never present. If <tt><font color=green>GTK_POLICY_AUTOMATIC</font></tt>, the scrollbar is present only if needed (that is, if the slider part of the bar would be smaller than the trough - the display is larger than the page size). <P> <tt><font color=blue>hscrollbar_policy</font></tt>: Policy for horizontal bar. <tt><font color=blue>vscrollbar_policy</font></tt>: Policy for vertical bar.</blockquote> <br><br> <a name="2675"><font size=+1><b>Gtk::ScrolledWindow::set_vadjustment</b></font></a> - Sets the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt> for the vertical scrollbar.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2675"><tt><font color=blue><b>set_vadjustment</b></font></tt></a><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>* <tt><font color=blue>vadjustment</font></tt>=0)</tt>;<br><blockquote> <tt><font color=blue>vadjustment</font></tt>: Vertical scroll adjustment.</blockquote> <br><br> <a name="2677"><font size=+1><b>Gtk::ScrolledWindow::set_vadjustment</b></font></a> - Sets the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a></tt> for the vertical scrollbar.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AScrolledWindow.html#2677"><tt><font color=blue><b>set_vadjustment</b></font></tt></a><tt>(<a href="Gtk%3A%3AAdjustment.html"><tt><font color=navy><b>Adjustment</b></font></tt></a>& <tt><font color=blue>vadjustment</font></tt>)</tt>;<br><blockquote> <tt><font color=blue>vadjustment</font></tt>: Vertical scroll adjustment.</blockquote> <br><br> <hr noshade> </html>