Infinite scrollable area containing child widgets and/or custom drawing
Class GtkLayout( [hadjustment],[vadjustment] )
hadjustment | (GtkAdjustment) horizontal scroll adjustment |
vadjustment | (GtkAdjustment) vertical scroll adjustment |
GtkLayout is similar to GtkDrawingArea 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 GtkScrolledWindow), and it can contain child widgets, since it's a GtkContainer. However if you're just going to draw, a GtkDrawingArea is a better choice since it has lower overhead.
When handling expose events on a GtkLayout, you must draw to GTK_LAYOUT (layout)->bin_window, rather than to GTK_WIDGET (layout)->window, as you would for a drawing area.
Methods | |
get_hadjustment | Returns the GtkAdjustment used for communication between the horizontal scrollbar and layout. |
get_size | Gets the size that has been set on the layout, and that determines the total extents of the layout's scrollbar area. |
get_vadjustment | Returns the GtkAdjustment used for communication between the vertical scrollbar and layout. |
move | Moves a current child of layout to a new position. |
put | Adds child_widget to layout, at position (x,y). layout becomes the new parent container of child_widget. |
set_hadjustment | Sets the horizontal scroll adjustment for the layout. |
set_size | Sets the size of the scrollable area of the layout. |
set_vadjustment | Sets the vertical scroll adjustment for the layout. |
Returns the GtkAdjustment used for communication between the horizontal scrollbar and layout.
GtkLayout.get_hadjustment()
Return | horizontal scroll adjustment |
This function should only be called after the layout has been placed in a GtkScrolledWindow or otherwise configured for scrolling. It returns the GtkAdjustment used for communication between the horizontal scrollbar and layout.
See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details.
Gets the size that has been set on the layout, and that determines the total extents of the layout's scrollbar area.
GtkLayout.get_size()
Return | [ width, height ] |
Returns the GtkAdjustment used for communication between the vertical scrollbar and layout.
GtkLayout.get_vadjustment()
Return | vertical scroll adjustment |
This function should only be called after the layout has been placed in a GtkScrolledWindow or otherwise configured for scrolling. It returns the GtkAdjustment used for communication between the vertical scrollbar and layout.
See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details.
Moves a current child of layout to a new position.
GtkLayout.move( child_widget, x, y )
child_widget | a current child of layout |
x | X position to move to |
y | Y position to move to |
Adds child_widget to layout, at position (x,y). layout becomes the new parent container of child_widget.
GtkLayout.put( child, x, y )
child | (GtkWidget) |
x | X position of child widget |
y | Y position of child widget |
Sets the horizontal scroll adjustment for the layout.
GtkLayout.set_hadjustment( adjustment )
adjustment | new scroll adjustment (or nil) |
See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details.
Sets the size of the scrollable area of the layout.
GtkLayout.set_size( width, height )
width | width of entire scrollable area |
height | height of entire scrollable area |
Sets the vertical scroll adjustment for the layout.
GtkLayout.set_vadjustment( adjustment )
adjustment | new scroll adjustment (or nil) See GtkScrolledWindow, GtkScrollbar, GtkAdjustment for details. |