_
WindowGtk_Scrolled_Window is a Gtk_Bin child: it's a container the accepts a single child widget. Gtk_Scrolled_Window adds scrollbars to the child widget.
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 (Conceptually, these widgets implement a "Scrollable" interface).
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_Scrolled_Window with Gtk.Container.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.
If you want to create your own new widget type that can be inserted directly into a scrolled_window, you need to specify a signal for Set_Scroll_Adjustments in the call to Gtk.Object.Initialize_Class_Record.
Widget Hierarchy |
---|
GObject (see section Package Glib.Object)
Gtk_Object (see section Package Gtk.Object)
\___ Gtk_Widget (see section Package Gtk.Widget)
\___ Gtk_Container (see section Package Gtk.Container)
\___ Gtk_Bin (see section Package Gtk.Bin)
\___ Gtk_Scrolled_Window (see section Package Gtk.Scrolled
|
Subprograms |
---|
procedure Gtk_New (Scrolled_Window : out Gtk_Scrolled_Window; Hadjustment : Gtk_Adjustment := Null_Adjustment; Vadjustment : Gtk_Adjustment := Null_Adjustment); | ||
Create a new scrolled window. | ||
function Get_Type return Gtk.Gtk_Type; | ||
Return the internal value associated with a Gtk_Scrolled_Window.
| ||
procedure Set_Hadjustment (Scrolled_Window : access Gtk_Scrolled_Window_Record; Hadjustment : Gtk_Adjustment); | ||
Set the Gtk_Adjustment for the horizontal scrollbar.
| ||
procedure Set_Vadjustment (Scrolled_Window : access Gtk_Scrolled_Window_Record; Vadjustment : Gtk_Adjustment); | ||
Set the Gtk_Adjustment for the vertical scrollbar.
| ||
function Get_Hadjustment (Scrolled_Window : access Gtk_Scrolled_Window_Record) return Gtk_Adjustment; | ||
Return the horizontal scrollbar's adjustment. | ||
function Get_Vadjustment (Scrolled_Window : access Gtk_Scrolled_Window_Record) return Gtk_Adjustment; | ||
Return the vertical scrollbar's adjustment. | ||
procedure Set_Policy (Scrolled_Window : access Gtk_Scrolled_Window_Record; H_Scrollbar_Policy : Enums.Gtk_Policy_Type; V_Scrollbar_Policy : Enums.Gtk_Policy_Type); | ||
Set the scrollbar policy for the horizontal and vertical scrollbars. | ||
procedure Get_Policy (Scrolled_Window : access Gtk_Scrolled_Window_Record; H_Scrollbar_Policy : out Enums.Gtk_Policy_Type; V_Scrollbar_Policy : out Enums.Gtk_Policy_Type); | ||
Return the scrollbar policy for the horizontal and vertical scrollbars.
| ||
procedure Set_Placement (Scrolled_Window : access Gtk_Scrolled_Window_Record; Window_Placement : Gtk.Enums.Gtk_Corner_Type); | ||
Determine the location of the widget with respect to the scrollbars. | ||
function Get_Placement (Scrolled_Window : access Gtk_Scrolled_Window_Record) return Gtk.Enums.Gtk_Corner_Type; | ||
Return the location of the widget with respect to the scrollbars.
| ||
procedure Set_Shadow_Type (Scrolled_Window : access Gtk_Scrolled_Window_Record; Shadow_Type : Gtk.Enums.Gtk_Shadow_Type); | ||
Change the type of shadow drawn around the contents of Scrolled_Window.
| ||
function Get_Shadow_Type (Scrolled_Window : access Gtk_Scrolled_Window_Record) return Gtk.Enums.Gtk_Shadow_Type; | ||
Return the type of shadow drawn around the contents of Scrolled_Window.
| ||
procedure Add_With_Viewport (Scrolled_Window : access Gtk_Scrolled_Window_Record; Child : access Gtk.Widget.Gtk_Widget_Record'Class); | ||
Used to add children without native scrolling capabilities. 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 GtkViewport proxy.
A widget supports scrolling natively if it contains a valid
"set_scroll_adjustments" signal.
|