The GBSizerItem class is used by the GridBagSizer for tracking the items in the sizer.
It adds grid position and spanning information to the normal SizerItem by adding GBPosition and GBSpan attributes. Most of the time you will not need to use a GBSizerItem directly in your code, but there are a couple of cases where it is handy.
__init__ | Construct a sizer item for tracking a spacer. |
GetEndPos | Get the row and column of the endpoint of this item. |
GetGBSizer | |
GetPos | Get the grid position of the item. |
GetSpan | Get the row and column spanning of the item. |
Intersects | Returns True if this item and the other item intersect. |
SetGBSizer | |
SetPos | If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one at the new position, then set the new position. |
SetSpan | If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one with its new spanning size, then set the new spanning. |
GBSizer | See GetGBSizer and SetGBSizer |
Pos | See GetPos and SetPos |
Span | See GetSpan and SetSpan |
The GBSizerItem class is used by the GridBagSizer for tracking the items in the sizer.
Possible constructors:
GBSizerItem(width, height, pos, span=DefaultSpan, flag=0, border=0,
userData=None)
GBSizerItem(window, pos, span=DefaultSpan, flag=0, border=0,
userData=None)
GBSizerItem(sizer, pos, span=DefaultSpan, flag=0, border=0,
userData=None)
Overloaded Implementations:
__init__ (self, width, height, pos, span=DefaultSpan, flag=0, border=0, userData=None)
Construct a sizer item for tracking a spacer.
Parameters: |
|
---|
__init__ (self, window, pos, span=DefaultSpan, flag=0, border=0, userData=None)
Construct a sizer item for tracking a window.
Parameters: |
|
---|
__init__ (self, sizer, pos, span=DefaultSpan, flag=0, border=0, userData=None)
Construct a sizer item for tracking a subsizer.
Parameters: |
|
---|
Get the row and column of the endpoint of this item.
Return type: | tuple |
---|---|
Returns: | ( row, col ) |
Return type: | GridBagSizer |
---|
Get the grid position of the item.
Get the row and column spanning of the item.
Overloaded Implementations:
Intersects (self, other)
Returns True if this item and the other item intersect.
Parameters: | other (GBSizerItem) – |
---|---|
Return type: | bool |
Intersects (self, pos, span)
Returns True if the given pos/span would intersect with this item.
Parameters: |
|
---|---|
Return type: | bool |
Parameters: | sizer (GridBagSizer) – |
---|
If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one at the new position, then set the new position.
Returns True if the change is successful and after the next Layout the item will be moved.
Parameters: | pos (GBPosition) – |
---|---|
Return type: | bool |
If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one with its new spanning size, then set the new spanning.
Returns True if the change is successful and after the next Layout the item will be resized.
Parameters: | span (GBSpan) – |
---|---|
Return type: | bool |
See GetGBSizer and SetGBSizer