Kit
Kit

Reputation: 31543

How do I get the size of an individual cell of a wx.GridSizer?

I'm wondering if I could get the size of an individual cell of a wx.GridSizer after calling Fit(). If so, how do I do that?

Upvotes: 0

Views: 182

Answers (1)

Steven Sproat
Steven Sproat

Reputation: 4578

item = sizer.GetItem(index)
size = item.GetSize()

How to find the item's index? From the documentation,

Items are placed in the cells of the grid in the order they are added, in row-major order. In other words, the first row is filled first, then the second, and so on until all items have been added. (If neccessary, additional rows will be added as items are added.)

Upvotes: 1

Related Questions