type Gtk_Scrolled_Window_Record is new Bin.Gtk_Bin_Record with private;
type Gtk_Scrolled_Window is access all Gtk_Scrolled_Window_Record'Class;
Hadjustment_Property : constant Glib.Properties.Property_Object;
Hscrollbar_Policy_Property : constant Gtk.Enums.Property_Gtk_Policy_Type;
Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type;
Vadjustment_Property : constant Glib.Properties.Property_Object;
Vscrollbar_Policy_Property : constant Gtk.Enums.Property_Gtk_Policy_Type;
Window_Placement_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type;
Window_Placement_Set_Property : constant Glib.Properties.Property_Boolean;
Scrollbar_Spacing_Property : constant Glib.Properties.Property_Int;
Scrollbars_Within_Bevel_Property : constant Glib.Properties.Property_Boolean;
Signal_Move_Focus_Out : constant Glib.Signal_Name := "move_focus_out";
Signal_Scroll_Child : constant Glib.Signal_Name := "scroll_child";
procedure Gtk_New
( | Scrolled_Window | : out Gtk_Scrolled_Window; |
Hadjustment | : Gtk_Adjustment := null; | |
Vadjustment | : Gtk_Adjustment := null); |
procedure Initialize
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record'Class; |
Hadjustment | : Gtk_Adjustment := null; | |
Vadjustment | : Gtk_Adjustment := null); |
function Get_Type return Gtk.Gtk_Type;
procedure Set_Hadjustment
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record; |
Hadjustment | : Gtk_Adjustment); |
function Get_Hadjustment
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record) return Gtk_Adjustment; |
procedure Set_Vadjustment
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record; |
Vadjustment | : Gtk_Adjustment); |
function Get_Vadjustment
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record) return Gtk_Adjustment; |
function Get_Hscrollbar
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record) return Gtk.Scrollbar.Gtk_Scrollbar; |
function Get_Vscrollbar
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record) return Gtk.Scrollbar.Gtk_Scrollbar; |
procedure Set_Policy
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record; |
H_Scrollbar_Policy | : Enums.Gtk_Policy_Type; | |
V_Scrollbar_Policy | : Enums.Gtk_Policy_Type); |
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); |
procedure Set_Placement
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record; |
Window_Placement | : Gtk.Enums.Gtk_Corner_Type); |
function Get_Placement
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record) return Gtk.Enums.Gtk_Corner_Type; |
procedure Unset_Placement
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record); |
procedure Set_Shadow_Type
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record; |
Shadow_Type | : Gtk.Enums.Gtk_Shadow_Type); |
function Get_Shadow_Type
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record) return Gtk.Enums.Gtk_Shadow_Type; |
procedure Add_With_Viewport
( | Scrolled_Window | : access Gtk_Scrolled_Window_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class); |
Gtk_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 Glib.Object.Initialize_Class_Record.
Binding from C File version 2.16.6
<testgtk>create_scrolled.adb</testgtk>