Do sizers work the same way for miniframes as for wx.Frame?
I'm trying to follow one of the examples from the Learn Sizers
tutorial by ean-Michel Fauth, Switzerland, unfortunately my results
are different.
1. When I stretch the frame in my code, the widgets do not stretch.
Stretching the frame in the LearnSizers code- the widgets stretch
& shrink accordingly.
2. When I call self.SetSizer(), all of my widgets are scrunched to the
upper left, and mostly invisible. The frame is still visible though.
This does not happen in the Learn Sizers program, which is how I based
my program.
# this code is from Learn Sizers: with_STaticBoxSizers.py
class MyPanel1(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
wred = ColWin(self, wx.ID_ANY, wx.RED)
wblue = ColWin(self, wx.ID_ANY, wx.BLUE)
wgreen = ColWin(self, wx.ID_ANY, wx.GREEN)
b = 10 #inside the staticbox
vsbsizer1 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY,
'StaticboxSizer with a caption'), wx.VERTICAL)
vsbsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
vsbsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
vsbsizer1.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
self.SetSizer(vsbsizer1)
# the code above is from Learn Sizers
# This is a small piece of my code
favoriteBox = wx.StaticBox(self._panel,wx.ID_ANY, "Favorite ",
pos=(10,10), size=sizeTup, style=wx.SB_RAISED )
favoriteSizer = wx.StaticBoxSizer(favoriteBox , wx.VERTICAL)
xStart = groupBox_X + 15
yStart = groupBox_Y + 25
self._lblFavorite = wx.StaticText(self._panel, wx.ID_ANY,
"Address", (xStart+21,yStart) )
self._tbFavorite = wx.TextCtrl(self._panel, wx.ID_ANY, pos=
(xStart,yStart+17), size=(80,20))
self._tbFavorite.SetFont(wx.Font(9, wx.FONTFAMILY_MODERN,
wx.NORMAL, wx.NORMAL))
border = 10
favoriteSizer.Add(self._lblFavorite, 1, wx.EXPAND | wx.ALL,
border)
favoriteSizer.Add(self._tbFavorite,1, wx.EXPAND | wx.ALL,
border)
# self.Sizer(favoriteSizer) # messes up the display
Does the miniFrame change how sizers respond?