package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Viewport_Record, Gtk_Viewport);
package Implements_Gtk_Scrollable is new Glib.Types.Implements (Gtk.Scrollable.Gtk_Scrollable, Gtk_Viewport_Record, Gtk_Viewport);
type Gtk_Viewport_Record is new Gtk_Bin_Record with null record;
type Gtk_Viewport is access all Gtk_Viewport_Record'Class;
Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type;
procedure Gtk_New
( | Viewport | : out Gtk_Viewport; |
Hadjustment | : Gtk.Adjustment.Gtk_Adjustment := null; | |
Vadjustment | : Gtk.Adjustment.Gtk_Adjustment := null); |
procedure Initialize
( | Viewport | : not null access Gtk_Viewport_Record'Class; |
Hadjustment | : Gtk.Adjustment.Gtk_Adjustment := null; | |
Vadjustment | : Gtk.Adjustment.Gtk_Adjustment := null); |
function Gtk_Viewport_New
( | Hadjustment | : Gtk.Adjustment.Gtk_Adjustment := null; |
Vadjustment | : Gtk.Adjustment.Gtk_Adjustment := null) return Gtk_Viewport; |
function Get_Type return Glib.GType;
function Get_Bin_Window
( | Viewport | : not null access Gtk_Viewport_Record) return Gdk.Gdk_Window; |
function Get_Shadow_Type
( | Viewport | : not null access Gtk_Viewport_Record) return Gtk.Enums.Gtk_Shadow_Type; |
procedure Set_Shadow_Type
( | Viewport | : not null access Gtk_Viewport_Record; |
The_Type | : Gtk.Enums.Gtk_Shadow_Type); |
function Get_View_Window
( | Viewport | : not null access Gtk_Viewport_Record) return Gdk.Gdk_Window; |
function Get_Hadjustment
( | Self | : not null access Gtk_Viewport_Record) return Gtk.Adjustment.Gtk_Adjustment; |
procedure Set_Hadjustment
( | Self | : not null access Gtk_Viewport_Record; |
Hadjustment | : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); |
function Get_Hscroll_Policy
( | Self | : not null access Gtk_Viewport_Record) return Gtk.Enums.Gtk_Scrollable_Policy; |
procedure Set_Hscroll_Policy
( | Self | : not null access Gtk_Viewport_Record; |
Policy | : Gtk.Enums.Gtk_Scrollable_Policy); |
function Get_Vadjustment
( | Self | : not null access Gtk_Viewport_Record) return Gtk.Adjustment.Gtk_Adjustment; |
procedure Set_Vadjustment
( | Self | : not null access Gtk_Viewport_Record; |
Vadjustment | : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); |
function Get_Vscroll_Policy
( | Self | : not null access Gtk_Viewport_Record) return Gtk.Enums.Gtk_Scrollable_Policy; |
procedure Set_Vscroll_Policy
( | Self | : not null access Gtk_Viewport_Record; |
Policy | : Gtk.Enums.Gtk_Scrollable_Policy); |
function "+"
( | Widget | : access Gtk_Viewport_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Viewport renames Implements_Gtk_Buildable.To_Object; |
function "+"
( | Widget | : access Gtk_Viewport_Record'Class) return Gtk.Scrollable.Gtk_Scrollable renames Implements_Gtk_Scrollable.To_Interface; |
function "-"
( | Interf | : Gtk.Scrollable.Gtk_Scrollable) return Gtk_Viewport renames Implements_Gtk_Scrollable.To_Object; |
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, such as Gtk.Text_View.Gtk_Text_View, Gtk.Tree_View.Gtk_Tree_View or Gtk.Icon_View.Gtk_Icon_View, it can be added to a 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 viewport to the scrolled window. Gtk.Container.Add does this automatically if a child that does not implement Gtk.Scrollable.Gtk_Scrollable is added to a Gtk.Scrolled_Window.Gtk_Scrolled_Window, so you can ignore the presence of the viewport.
The Gtk.Viewport.Gtk_Viewport will start scrolling content only if allocated less than the child widget's minimum size in a given orientation.