# wx.GBSizerItem¶

The wx.GBSizerItem class is used by the wx.GridBagSizer for tracking the items in the sizer.

It adds grid position and spanning information to the normal wx.SizerItem by adding wx.GBPosition and wx.GBSpan attributes. Most of the time you will not need to use a wx.GBSizerItem directly in your code, but there are a couple of cases where it is handy.

## Class Hierarchy¶

Inheritance diagram for class GBSizerItem:

## Methods Summary¶

 __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.

## Class API¶

class wx.GBSizerItem(SizerItem)

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)


The GBSizerItem class is used by the GridBagSizer for tracking the items in the sizer.

### Methods¶

__init__(self, *args, **kw)

__init__ (self, width, height, pos, span=DefaultSpan, flag=0, border=0, userData=None)

Construct a sizer item for tracking a spacer.

Parameters
• width (int) –

• height (int) –

• pos (wx.GBPosition) –

• span (wx.GBSpan) –

• flag (int) –

• border (int) –

• userData (PyUserData) –

__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

GetEndPos(self)

Get the row and column of the endpoint of this item.

Return type

tuple

Returns

( row, col )

GetGBSizer(self)
Return type

wx.GridBagSizer

GetPos(self)

Get the grid position of the item.

Return type

wx.GBPosition

GetSpan(self)

Get the row and column spanning of the item.

Return type

wx.GBSpan

Intersects(self, *args, **kw)

Intersects (self, other)

Returns True if this item and the other item intersect.

Parameters

other (wx.GBSizerItem) –

Return type

bool

Intersects (self, pos, span)

Returns True if the given pos/span would intersect with this item.

Parameters
Return type

bool

SetGBSizer(self, sizer)
Parameters

sizer (wx.GridBagSizer) –

SetPos(self, pos)

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 (wx.GBPosition) –

Return type

bool

SetSpan(self, span)

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 (wx.GBSpan) –

Return type

bool

### Properties¶

GBSizer

Pos

Span