Infinite scrollable area containing child widgets and/or custom drawing
<gtk-layout>
is similar to <gtk-drawing-area>
in that it's a
"blank slate" and doesn't do anything but paint a blank background by default.
It's different in that it supports scrolling natively (you can add it to a
<gtk-scrolled-window>
), and it can contain child widgets, since it's a
<gtk-container>
. However if you're just going to draw, a
<gtk-drawing-area>
is a better choice since it has lower overhead.
When handling expose events on a <gtk-layout>
, you must draw to
GTK_LAYOUT (layout)->bin_window, rather than to GTK_WIDGET (layout)->window, as
you would for a drawing area.
Derives from
<gtk-container>
.This class defines the following slots:
hadjustment
- The GtkAdjustment for the horizontal position
vadjustment
- The GtkAdjustment for the vertical position
width
- The width of the layout
height
- The height of the layout
<gtk-adjustment>
) (vadjustment <gtk-adjustment>
) ⇒ (ret <gtk-widget>
)Creates a new
<gtk-layout>
. Unless you have a specific adjustment you'd like the layout to use for scrolling, pass ‘#f
’ for hadjustment and vadjustment.
- hadjustment
- horizontal scroll adjustment, or ‘
#f
’- vadjustment
- vertical scroll adjustment, or ‘
#f
’- ret
- a new
<gtk-layout>
<gtk-layout>
) (child_widget <gtk-widget>
) (x int
) (y int
)Adds child-widget to layout, at position (x,y). layout becomes the new parent container of child-widget.
- layout
- a
<gtk-layout>
- child-widget
- child widget
- x
- X position of child widget
- y
- Y position of child widget
<gtk-layout>
) (child_widget <gtk-widget>
) (x int
) (y int
)Moves a current child of layout to a new position.
- layout
- a
<gtk-layout>
- child-widget
- a current child of layout
- x
- X position to move to
- y
- Y position to move to
<gtk-layout>
) (width unsigned-int
) (height unsigned-int
)Sets the size of the scrollable area of the layout.
- layout
- a
<gtk-layout>
- width
- width of entire scrollable area
- height
- height of entire scrollable area
<gtk-layout>
) ⇒ (width unsigned-int
) (height unsigned-int
)Gets the size that has been set on the layout, and that determines the total extents of the layout's scrollbar area. See
gtk-layout-set-size
.
- layout
- a
<gtk-layout>
- width
- location to store the width set on layout, or ‘
#f
’- height
- location to store the height set on layout, or ‘
#f
’
<gtk-layout>
) ⇒ (ret <gtk-adjustment>
)This function should only be called after the layout has been placed in a
<gtk-scrolled-window>
or otherwise configured for scrolling. It returns the<gtk-adjustment>
used for communication between the horizontal scrollbar and layout.See
<gtk-scrolled-window>
,<gtk-scrollbar>
,<gtk-adjustment>
for details.
- layout
- a
<gtk-layout>
- ret
- horizontal scroll adjustment
<gtk-layout>
) ⇒ (ret <gtk-adjustment>
)This function should only be called after the layout has been placed in a
<gtk-scrolled-window>
or otherwise configured for scrolling. It returns the<gtk-adjustment>
used for communication between the vertical scrollbar and layout.See
<gtk-scrolled-window>
,<gtk-scrollbar>
,<gtk-adjustment>
for details.
- layout
- a
<gtk-layout>
- ret
- vertical scroll adjustment