The window's default size handler is where its sizer is used to automatically do the layout, so if there is no size event after the items have been added to a sizer and SetSizer has been called then there will be no automatic layout and the items will be seen in their default positions and sizes. Usually calling Layout() yourself after the items have been created and added to the sizer will work in those cases.
···
On 10/17/11 2:07 AM, 최원준 wrote:
2011/10/17 werner <wbruhin@free.fr <mailto:wbruhin@free.fr>>
Hi Wonjun Choi,
On 10/17/2011 10:20 AM, Wonjun, Choi wrote:
I declared 2 stc control with FlexGridSizer
before adding stc to GridSizer, self.stc1 and self.stc2 is already
displayed which are overrapped.
Hi Wonjun Choi,
On 10/17/2011 10:20 AM, Wonjun, Choi wrote:
I declared 2 stc control with FlexGridSizer
before adding stc to GridSizer, self.stc1 and self.stc2 is already
displayed which are overrapped.
it is overlapped:-)
I declared like this
self.stc1 = STC(self)
self.stc2 = STC(self)
self.Autosizer = wx.FlexGridSizer(rows=1, cols=2)
self.Autosizer.Add(e,1, wx.EXPAND)
what is "e" in the above?
Do you add stc1 and stc2 to Autosizer somewhere in your code?
e.g. you should have:
self.Autosizer.Add(self.stc1, 1, wx.EXPAND)
self.Autosizer.Add(self.stc2, 1, wx.EXPAND)
I did but I can see the controls without GridSizer.
The window’s default size handler is where its sizer is used to automatically do the layout, so if there is no size event after the items have been added to a sizer and SetSizer has been called then there will be no automatic layout and the items will be seen in their default positions and sizes. Usually calling Layout() yourself after the items have been created and added to the sizer will work in those cases.