Gtk.Layout¶
- Subclasses:
 None
Methods¶
- Inherited:
 Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Scrollable (9)
- Structs:
 Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w/en  | 
The height of the layout  | 
||
r/w/en  | 
The width of the layout  | 
Child Properties¶
Name  | 
Type  | 
Default  | 
Flags  | 
Short Description  | 
|---|---|---|---|---|
  | 
  | 
r/w  | 
X position of child widget  | 
|
  | 
  | 
r/w  | 
Y position of child widget  | 
Style Properties¶
- Inherited:
 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
container  | 
r  | 
Class Details¶
- class Gtk.Layout(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
Gtk.Layoutis similar toGtk.DrawingAreain that it’s a “blank slate” and doesn’t do anything except paint a blank background by default. It’s different in that it supports scrolling natively due to implementingGtk.Scrollable, and can contain child widgets since it’s aGtk.Container.If you just want to draw, a
Gtk.DrawingAreais a better choice since it has lower overhead. If you just need to position child widgets at specific points, thenGtk.Fixedprovides that functionality on its own.When handling expose events on a
Gtk.Layout, you must draw to theGdk.Windowreturned byGtk.Layout.get_bin_window(), rather than to the one returned byGtk.Widget.get_window() as you would for aGtk.DrawingArea.- classmethod new(hadjustment, vadjustment)[source]¶
 - Parameters:
 hadjustment (
Gtk.AdjustmentorNone) – horizontal scroll adjustment, orNonevadjustment (
Gtk.AdjustmentorNone) – vertical scroll adjustment, orNone
- Returns:
 a new
Gtk.Layout- Return type:
 
Creates a new
Gtk.Layout. Unless you have a specific adjustment you’d like the layout to use for scrolling, passNonefor hadjustment and vadjustment.
- get_bin_window()[source]¶
 - Returns:
 - Return type:
 
Retrieve the bin window of the layout used for drawing operations.
New in version 2.14.
- get_hadjustment()[source]¶
 - Returns:
 horizontal scroll adjustment
- Return type:
 
This function should only be called after the layout has been placed in a
Gtk.ScrolledWindowor otherwise configured for scrolling. It returns theGtk.Adjustmentused for communication between the horizontal scrollbar and self.See
Gtk.ScrolledWindow,Gtk.Scrollbar,Gtk.Adjustmentfor details.Deprecated since version 3.0: Use
Gtk.Scrollable.get_hadjustment()
- get_size()[source]¶
 - Returns:
 - Return type:
 
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().
- get_vadjustment()[source]¶
 - Returns:
 vertical scroll adjustment
- Return type:
 
This function should only be called after the layout has been placed in a
Gtk.ScrolledWindowor otherwise configured for scrolling. It returns theGtk.Adjustmentused for communication between the vertical scrollbar and self.See
Gtk.ScrolledWindow,Gtk.Scrollbar,Gtk.Adjustmentfor details.Deprecated since version 3.0: Use
Gtk.Scrollable.get_vadjustment()
- move(child_widget, x, y)[source]¶
 - Parameters:
 child_widget (
Gtk.Widget) – a current child of selfx (
int) – X position to move toy (
int) – Y position to move to
Moves a current child of self to a new position.
- put(child_widget, x, y)[source]¶
 - Parameters:
 child_widget (
Gtk.Widget) – child widgetx (
int) – X position of child widgety (
int) – Y position of child widget
Adds child_widget to self, at position (x,`y`). self becomes the new parent container of child_widget.
- set_hadjustment(adjustment)[source]¶
 - Parameters:
 adjustment (
Gtk.AdjustmentorNone) – new scroll adjustment
Sets the horizontal scroll adjustment for the layout.
See
Gtk.ScrolledWindow,Gtk.Scrollbar,Gtk.Adjustmentfor details.Deprecated since version 3.0: Use
Gtk.Scrollable.set_hadjustment()
- set_vadjustment(adjustment)[source]¶
 - Parameters:
 adjustment (
Gtk.AdjustmentorNone) – new scroll adjustment
Sets the vertical scroll adjustment for the layout.
See
Gtk.ScrolledWindow,Gtk.Scrollbar,Gtk.Adjustmentfor details.Deprecated since version 3.0: Use
Gtk.Scrollable.set_vadjustment()
Property Details¶
- Gtk.Layout.props.height¶
 - Name:
 height- Type:
 - Default Value:
 100- Flags:
 
The height of the layout
- Gtk.Layout.props.width¶
 - Name:
 width- Type:
 - Default Value:
 100- Flags:
 
The width of the layout