Class Index | Cross Index | Namespace Index |
Adds scrollbars to its child widget.
Contained in: Gtk
Derived from:
Gtk::Bin
Derived by:
none
#include <gtk--/scrolledwindow.h>
public function member index: |
||
ScrolledWindow | (Adjustment& hadjustment, Adjustment& vadjustment); | |
ScrolledWindow | (); | |
void | add_with_viewport | (Gtk::Widget& child); |
Adjustment* | get_hadjustment | () const; |
HScrollbar* | get_hscrollbar | () const; |
GtkPolicyType | get_hscrollbar_policy | () const; |
bool | get_hscrollbar_visible | () const; |
GtkCornerType | get_placement | () const; |
Adjustment* | get_vadjustment | () const; |
VScrollbar* | get_vscrollbar | () const; |
GtkPolicyType | get_vscrollbar_policy | () const; |
bool | get_vscrollbar_visible | () const; |
GtkScrolledWindow* | gtkobj | (); |
const GtkScrolledWindow* | gtkobj | () const; |
static bool | isA | (Object* object); |
void | set_hadjustment | (Adjustment* hadjustment=0); |
void | set_hadjustment | (Adjustment& hadjustment); |
void | set_placement | (GtkCornerType window_placement); |
void | set_policy | (GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy); |
void | set_vadjustment | (Adjustment* vadjustment=0); |
void | set_vadjustment | (Adjustment& vadjustment); |
virtual | ~ScrolledWindow | (); |
The scrolled window can work in two ways. Some widgets have native scrolling support; these widgets have slots for Gtk::Adjustment objects. The scrolled window installs Gtk::Adjustment objects in the child window's slots using the set_scroll_adjustments_signal, found in the Gtk::Widget Class. (This is how it works in GTK+, not sure about GTK--).
The second way to use the scrolled window is useful with widgets that lack the set_scroll_adjustments_signal. The Gtk::Viewport widget acts as a proxy, implementing scrollability for child widgets that lack their own scrolling capabilities.
If a widget has native scrolling abilities, it can be added to the
Gtk::ScrolledWindow with add. If a widget does not, you must first add
the widget to a Gtk::Viewport, then add the Gtk::Viewport to the scrolled
window. The convenience function add_with_viewport does exactly this, so you can
ignore the presence of the viewport.
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 add instead of this function.The viewport scrolls the child by moving its Gdk::Window, and takes the size of the child to be the size of its toplevel Gdk::Window. This will be very wrong for most widgets that support native scrolling; for example, if you add a Gtk::CList with a viewport, the whole widget will scroll, including the column headings. Thus Gtk::CList supports scrolling already, and should not be used with the Gtk::Viewport proxy. child: Widget you want to scroll.
Returns: The horizontal Gtk::Adjustment.
Returns: The vertical Gtk::Adjustment.
hadjustment: Horizontal scroll adjustment.
hadjustment: Horizontal scroll adjustment.
The default is GTK_CORNER_TOP_LEFT, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in GtkCornerType are GTK_CORNER_TOP_RIGHT, GTK_CORNER_BOTTOM_LEFT, and GTK_CORNER_BOTTOM_RIGHT. window_placement: Position of the child window.
The policy determines when the scrollbar should appear; it is a value from the GtkPolicyType enumeration. If GTK_POLICY_ALWAYS, the scrollbar is always present. If GTK_POLICY_NEVER, the scrollbar is never present. If GTK_POLICY_AUTOMATIC, 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).hscrollbar_policy: Policy for horizontal bar. vscrollbar_policy: Policy for vertical bar.
vadjustment: Vertical scroll adjustment.
vadjustment: Vertical scroll adjustment.