gtk.Layout
gtk.Layout — infinite scrollable area containing child widgets and custom
drawing
gtk.Layout Child Properties
Description
The gtk.Layout is a
simple container widget similar to the gtk.Fixed container
widget. Like the gtk.Fixed the gtk.Layout places a
child widget at a specific position within the container. The gtk.Layout offers
two features beyond the gtk.Fixed
widget:
- a very large width and height for the container - limited
by the size of an unsigned integer.
- horizontal and vertical adjustments can be specified for
use with scrollbars, etc.
The gtk.Layout can also
be drawn on similar to drawing on a gtk.DrawingArea.
When handling expose events on a gtk.Layout, you must
draw to the window specified by the bin_window attribute
rather than the widget window attribute.
Constructor
gtk.Layout(hadjustment=None, vadjustment=None)
|
hadjustment : | horizontal adjustment, or
None |
vadjustment : | vertical adjustment, or
None |
Returns : | a new gtk.Layout |
Creates a new gtk.Layout. Usually
the hadjustment and
vadjustment arguments are not specified or are
specified as None, so that new adjustments are
created.
Methods
gtk.Layout.put
def put(child_widget, x, y)
|
child_widget : | the child widget |
x : | the X position of child
widget |
y : | the Y position of child
widget |
The put() method adds
child_widget to the layout and places its upper, left
corner at the position specified by x and
y.
gtk.Layout.move
def move(child_widget, x, y)
|
child_widget : | a current child of the
layout |
x : | the X position to move
child_widget to |
y : | the Y position to move
child_widget to |
The move() method moves a current child
of the layout (specified by child_widget) to the new
position specified by x and y.
The upper, left corner of child_widget will be placed
at (x, y).
gtk.Layout.set_size
def set_size(width, height)
|
width : | width of the layout area |
height : | height of the layout area |
The set_size() method sets the size of
the virtual area of the layout to the values specified by
width and height. The "width"
and "height" properties are also set by this method.
gtk.Layout.get_size
Returns : | a tuple containing the width and height set on
layout |
The get_size() method returns a tuple
that contains the width and height of the virtual size that has been set on
the layout. See set_size().
gtk.Layout.get_hadjustment
Returns : | a horizontal adjustment |
The get_hadjustment() method returns
the value of the "hadjustment" property that contains the horizontal
adjustment object associated with the layout. This function should only be
called after the layout has been placed in a gtk.ScrolledWindow
or has otherwise been configured for scrolling. See gtk.ScrolledWindow,
gtk.Scrollbar,
gtk.Adjustment
for details.
gtk.Layout.get_vadjustment
Returns : | a vertical adjustment |
The get_vadjustment() method returns
the "vadjustment" property that contains the vertical adjustment object
associated with the layout. This function should only be called after the
layout has been placed in a gtk.ScrolledWindow
or has otherwise been configured for scrolling. See gtk.ScrolledWindow,
gtk.Scrollbar,
gtk.Adjustment
for details.
gtk.Layout.set_hadjustment
def set_hadjustment(adjustment)
|
adjustment : | a horizontal adjustment |
The set_hadjustment() method sets the
horizontal adjustment for the layout (and the "hadjustment" property) to the
value of adjustment. See gtk.ScrolledWindow,
gtk.Scrollbar,
gtk.Adjustment
for details.
gtk.Layout.set_vadjustment
def set_vadjustment(adjustment)
|
adjustment : | a vertical adjustment |
The set_vadjustment() method sets the
vertical adjustment for the layout (and the "vadjustment" property) to the
value of adjustment. See gtk.ScrolledWindow,
gtk.Scrollbar,
gtk.Adjustment
for details.
Signals
The "set-scroll-adjustments" gtk.Layout Signal
def callback(layout, hadjustment, vadjustment, user_param1, ...)
|
layout : | the layout that received the
signal |
hadjustment : | the horizontal adjustment associated with the
layout. |
vadjustment : | the horizontal adjustment associated with the
layout. |
user_param1 : | the first user parameter (if any) specified
with the connect()
method |
... : | additional user parameters (if
any) |
The "set-scroll-adjustments" signal is emitted when one of the
adjustments associated with a layout is changed.