package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Scrolled_Window_Record, Gtk_Scrolled_Window);
type Gtk_Scrolled_Window_Record is new Gtk_Bin_Record with null record;
type Gtk_Scrolled_Window is access all Gtk_Scrolled_Window_Record'Class;
type Cb_Gtk_Scrolled_Window_Gtk_Direction_Type_Void is not null access procedure (Self : access Gtk_Scrolled_Window_Record'Class; Direction_Type : Gtk.Enums.Gtk_Direction_Type);
type Cb_GObject_Gtk_Direction_Type_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class; Direction_Type : Gtk.Enums.Gtk_Direction_Type);
type Cb_Gtk_Scrolled_Window_Gtk_Scroll_Type_Boolean_Boolean is not null access function (Self : access Gtk_Scrolled_Window_Record'Class; Scroll : Gtk.Enums.Gtk_Scroll_Type; Horizontal : Boolean) return Boolean;
type Cb_GObject_Gtk_Scroll_Type_Boolean_Boolean is not null access function (Self : access Glib.Object.GObject_Record'Class; Scroll : Gtk.Enums.Gtk_Scroll_Type; Horizontal : Boolean) return Boolean;
Hadjustment_Property : constant Glib.Properties.Property_Object;
Hscrollbar_Policy_Property : constant Gtk.Enums.Property_Gtk_Policy_Type;
Kinetic_Scrolling_Property : constant Glib.Properties.Property_Boolean;
Min_Content_Height_Property : constant Glib.Properties.Property_Int;
Min_Content_Width_Property : constant Glib.Properties.Property_Int;
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_Corner_Type;
Window_Placement_Set_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.Gtk_Adjustment := null; | |
Vadjustment | : Gtk.Adjustment.Gtk_Adjustment := null); |
procedure Initialize
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record'Class; |
Hadjustment | : Gtk.Adjustment.Gtk_Adjustment := null; | |
Vadjustment | : Gtk.Adjustment.Gtk_Adjustment := null); |
function Gtk_Scrolled_Window_New
( | Hadjustment | : Gtk.Adjustment.Gtk_Adjustment := null; |
Vadjustment | : Gtk.Adjustment.Gtk_Adjustment := null) return Gtk_Scrolled_Window; |
function Get_Type return Glib.GType;
procedure Add_With_Viewport
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class); |
function Get_Capture_Button_Press
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Boolean; |
procedure Set_Capture_Button_Press
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Capture_Button_Press | : Boolean); |
function Get_Hadjustment
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gtk.Adjustment.Gtk_Adjustment; |
procedure Set_Hadjustment
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Hadjustment | : not null access Gtk.Adjustment.Gtk_Adjustment_Record'Class); |
function Get_Hscrollbar
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gtk.Scrollbar.Gtk_Scrollbar; |
function Get_Kinetic_Scrolling
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Boolean; |
procedure Set_Kinetic_Scrolling
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Kinetic_Scrolling | : Boolean); |
function Get_Min_Content_Height
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gint; |
procedure Set_Min_Content_Height
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Height | : Gint); |
function Get_Min_Content_Width
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gint; |
procedure Set_Min_Content_Width
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Width | : Gint); |
function Get_Placement
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gtk.Enums.Gtk_Corner_Type; |
procedure Set_Placement
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Window_Placement | : Gtk.Enums.Gtk_Corner_Type); |
procedure Get_Policy
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Hscrollbar_Policy | : out Gtk.Enums.Gtk_Policy_Type; | |
Vscrollbar_Policy | : out Gtk.Enums.Gtk_Policy_Type); |
procedure Set_Policy
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Hscrollbar_Policy | : Gtk.Enums.Gtk_Policy_Type; | |
Vscrollbar_Policy | : Gtk.Enums.Gtk_Policy_Type); |
function Get_Shadow_Type
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gtk.Enums.Gtk_Shadow_Type; |
procedure Set_Shadow_Type
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
The_Type | : Gtk.Enums.Gtk_Shadow_Type); |
function Get_Vadjustment
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gtk.Adjustment.Gtk_Adjustment; |
procedure Set_Vadjustment
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record; |
Vadjustment | : not null access Gtk.Adjustment.Gtk_Adjustment_Record'Class); |
function Get_Vscrollbar
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record) return Gtk.Scrollbar.Gtk_Scrollbar; |
procedure Unset_Placement
( | Scrolled_Window | : not null access Gtk_Scrolled_Window_Record); |
procedure On_Move_Focus_Out
( | Self | : not null access Gtk_Scrolled_Window_Record; |
Call | : Cb_Gtk_Scrolled_Window_Gtk_Direction_Type_Void; | |
After | : Boolean := False); |
procedure On_Move_Focus_Out
( | Self | : not null access Gtk_Scrolled_Window_Record; |
Call | : Cb_GObject_Gtk_Direction_Type_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
procedure On_Scroll_Child
( | Self | : not null access Gtk_Scrolled_Window_Record; |
Call | : Cb_Gtk_Scrolled_Window_Gtk_Scroll_Type_Boolean_Boolean; | |
After | : Boolean := False); |
procedure On_Scroll_Child
( | Self | : not null access Gtk_Scrolled_Window_Record; |
Call | : Cb_GObject_Gtk_Scroll_Type_Boolean_Boolean; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
function "+"
( | Widget | : access Gtk_Scrolled_Window_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Scrolled_Window renames Implements_Gtk_Buildable.To_Object; |
Gtk.Scrolled_Window.Gtk_Scrolled_Window is a Gtk.Bin.Gtk_Bin subclass: it's a container the accepts a single child widget.
Gtk.Scrolled_Window.Gtk_Scrolled_Window adds scrollbars to the child widget and optionally draws a beveled frame around the child widget.
The scrolled window can work in two ways. Some widgets have native scrolling support; these widgets implement the Gtk.Scrollable.Gtk_Scrollable interface. Widgets with native scroll support include Gtk.Tree_View.Gtk_Tree_View, Gtk.Text_View.Gtk_Text_View, and Gtk.Layout.Gtk_Layout.
For widgets that lack native scrolling support, the Gtk.Viewport.Gtk_Viewport widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities.
Use Gtk.Viewport.Gtk_Viewport to scroll child widgets such as Gtk.Grid.Gtk_Grid, Gtk.Box.Gtk_Box, and so on.
If a widget has native scrolling abilities, it can be added to the Gtk.Scrolled_Window.Gtk_Scrolled_Window with Gtk.Container.Add. If a widget does not, you must first add the widget to a Gtk.Viewport.Gtk_Viewport, then add the Gtk.Viewport.Gtk_Viewport to the scrolled window.
Gtk.Container.Add will do this for you for widgets that don't implement Gtk.Scrollable.Gtk_Scrollable natively, so you can ignore the presence of the viewport.
The position of the scrollbars is controlled by the scroll adjustments.
See Gtk.Adjustment.Gtk_Adjustment for the fields in an adjustment - for Gtk.Scrollbar.Gtk_Scrollbar, used by Gtk.Scrolled_Window.Gtk_Scrolled_Window, the "value" field represents the position of the scrollbar, which must be between the "lower" field and "upper - page_size." The "page_size" field represents the size of the visible scrollable area. The "step_increment" and "page_increment" fields are used when the user asks to step down (using the small stepper arrows) or page down (using for example the PageDown key).
If a Gtk.Scrolled_Window.Gtk_Scrolled_Window doesn't behave quite as you would like, or doesn't have exactly the right layout, it's very possible to set up your own scrolling with Gtk.Scrollbar.Gtk_Scrollbar and for example a Gtk.Grid.Gtk_Grid.