Below is the base class of my pythoncard application
class MyBackground(model.Background):
def on_initialize(self, event):
# if you have any initialization
# including sizer setup, do it here
self.setLayout()
def setLayout(self):
sizer1 = wx.BoxSizer(wx.VERTICAL) # main sizer
for item in self.components.itervalues():
item.SetSize(item.GetBestSize())
print item.GetBestSize(),item.GetSize() # here
sizer1.Add(item, 0, wx.ALL, 10)
sizer1.Fit(self)
self.panel.SetSizer(sizer1)
self.panel.Layout()
self.visible = 1
which uses the resource file with content below
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':u'Standard Template with no menus',
'size': (800, 600),
'statusBar':1,
'style':['wx.MINIMIZE_BOX', 'wx.CLOSE_BOX', 'wx.MAXIMIZE_BOX', 'wx.FRAME_SHAPED', 'wx.CAPTION',
'wx.DEFAULT_FRAME_STYLE', 'wx.FULL_REPAINT_ON_RESIZE', 'wx.HW_SCROLLBAR_AUTO'],
'components': [
{'backgroundColor': '&H00FFFFFF&',
'name': 'MinMax0',
'position': (1080, 9900),
'size': (732, 220),
'text': '10000',
'type': 'TextField'}]}]}
line marked with 'here' prints (80, 21) (732, 220) , which i expected to be (80, 21) (80, 21). How can i set the size of the components in pythoncard application?