Gtk.Viewport

Entities

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

The Gtk.Viewport.Gtk_Viewport widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. Use GtkViewport 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 GtkViewport will start scrolling content only if allocated less than the child widget's minimum size in a given orientation.

# CSS nodes

GtkViewport has a single CSS node with name viewport.

<group>Scrolling</group>

"+"

function "+"
  (Widget : access Gtk_Viewport_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"+"

function "+"
  (Widget : access Gtk_Viewport_Record'Class)
return Gtk.Scrollable.Gtk_Scrollable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Viewport
Parameters
Interf
Return Value

"-"

function "-"
  (Interf : Gtk.Scrollable.Gtk_Scrollable)
return Gtk_Viewport
Parameters
Interf
Return Value

Get_Bin_Window

function Get_Bin_Window
   (Viewport : not null access Gtk_Viewport_Record) return Gdk.Gdk_Window

Gets the bin window of the Gtk.Viewport.Gtk_Viewport. Since: gtk+ 2.20

Parameters
Viewport
Return Value

a Gdk.Gdk_Window

Get_Border

function Get_Border
   (Self   : not null access Gtk_Viewport_Record;
    Border : access Gtk.Style.Gtk_Border) return Boolean
Parameters
Self
Border
Return Value

Get_Hadjustment

function Get_Hadjustment
   (Self : not null access Gtk_Viewport_Record)
    return Gtk.Adjustment.Gtk_Adjustment
Parameters
Self
Return Value

Get_Hscroll_Policy

function Get_Hscroll_Policy
   (Self : not null access Gtk_Viewport_Record)
    return Gtk.Enums.Gtk_Scrollable_Policy
Parameters
Self
Return Value

Get_Shadow_Type

function Get_Shadow_Type
   (Viewport : not null access Gtk_Viewport_Record)
    return Gtk.Enums.Gtk_Shadow_Type

Gets the shadow type of the Gtk.Viewport.Gtk_Viewport. See Gtk.Viewport.Set_Shadow_Type.

Parameters
Viewport
Return Value

the shadow type

Get_Type

function Get_Type return Glib.GType
Return Value

Get_Vadjustment

function Get_Vadjustment
   (Self : not null access Gtk_Viewport_Record)
    return Gtk.Adjustment.Gtk_Adjustment
Parameters
Self
Return Value

Get_View_Window

function Get_View_Window
   (Viewport : not null access Gtk_Viewport_Record) return Gdk.Gdk_Window

Gets the view window of the Gtk.Viewport.Gtk_Viewport. Since: gtk+ 2.22

Parameters
Viewport
Return Value

a Gdk.Gdk_Window

Get_Vscroll_Policy

function Get_Vscroll_Policy
   (Self : not null access Gtk_Viewport_Record)
    return Gtk.Enums.Gtk_Scrollable_Policy
Parameters
Self
Return Value

Gtk_New

procedure Gtk_New
   (Viewport    : out Gtk_Viewport;
    Hadjustment : Gtk.Adjustment.Gtk_Adjustment := null;
    Vadjustment : Gtk.Adjustment.Gtk_Adjustment := null)

Creates a new Gtk.Viewport.Gtk_Viewport with the given adjustments, or with default adjustments if none are given. Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Viewport
Hadjustment

horizontal adjustment

Vadjustment

vertical adjustment

Gtk_Viewport

type Gtk_Viewport is access all Gtk_Viewport_Record'Class;

Gtk_Viewport_New

function Gtk_Viewport_New
   (Hadjustment : Gtk.Adjustment.Gtk_Adjustment := null;
    Vadjustment : Gtk.Adjustment.Gtk_Adjustment := null)
    return Gtk_Viewport

Creates a new Gtk.Viewport.Gtk_Viewport with the given adjustments, or with default adjustments if none are given.

Parameters
Hadjustment

horizontal adjustment

Vadjustment

vertical adjustment

Return Value

Gtk_Viewport_Record

type Gtk_Viewport_Record is new Gtk_Bin_Record with null record;

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Viewport_Record, Gtk_Viewport);

Implements_Gtk_Scrollable

package Implements_Gtk_Scrollable is new Glib.Types.Implements
  (Gtk.Scrollable.Gtk_Scrollable, Gtk_Viewport_Record, Gtk_Viewport);

Initialize

procedure Initialize
   (Viewport    : not null access Gtk_Viewport_Record'Class;
    Hadjustment : Gtk.Adjustment.Gtk_Adjustment := null;
    Vadjustment : Gtk.Adjustment.Gtk_Adjustment := null)

Creates a new Gtk.Viewport.Gtk_Viewport with the given adjustments, or with default adjustments if none are given. Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Viewport
Hadjustment

horizontal adjustment

Vadjustment

vertical adjustment

Set_Hadjustment

procedure Set_Hadjustment
   (Self        : not null access Gtk_Viewport_Record;
    Hadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
Parameters
Self
Hadjustment

Set_Hscroll_Policy

procedure Set_Hscroll_Policy
   (Self   : not null access Gtk_Viewport_Record;
    Policy : Gtk.Enums.Gtk_Scrollable_Policy)
Parameters
Self
Policy

Set_Shadow_Type

procedure Set_Shadow_Type
   (Viewport : not null access Gtk_Viewport_Record;
    The_Type : Gtk.Enums.Gtk_Shadow_Type)

Sets the shadow type of the viewport.

Parameters
Viewport
The_Type

the new shadow type.

Set_Vadjustment

procedure Set_Vadjustment
   (Self        : not null access Gtk_Viewport_Record;
    Vadjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class)
Parameters
Self
Vadjustment

Set_Vscroll_Policy

procedure Set_Vscroll_Policy
   (Self   : not null access Gtk_Viewport_Record;
    Policy : Gtk.Enums.Gtk_Scrollable_Policy)
Parameters
Self
Policy

Shadow_Type_Property

Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type;