Hello folks
Any thoughts what is the diff between line 46 and 47?
http://paste.pocoo.org/show/105695/
Doing 46 shows up the textbox in center but 47 dosnt?
···
--
Ritesh
http://www.riteshn.com
Hello folks
Any thoughts what is the diff between line 46 and 47?
http://paste.pocoo.org/show/105695/
Doing 46 shows up the textbox in center but 47 dosnt?
--
Ritesh
http://www.riteshn.com
Ritesh Nadhani <riteshn@gmail.com> writes:
Any thoughts what is the diff between line 46 and 47?
http://paste.pocoo.org/show/105695/
Doing 46 shows up the textbox in center but 47 dosnt?
It's probably due to the difference in timing. Using the event
binding you have to wait for the PostEvent to be processed and the
event delivered, which will be after the construction of MyScreen
completes and you return to (or rather, initiate in this case) the
event loop.
With 46, the text control is added to the sizer before the frame is
shown (which I believe in turn will cause it to resize its single
child to match its size, thus causing the sizer to re-lay everything
out). With 47, the text control is added after all of that initial
display/layout has occurred.
I suspect that calling Layout() again after adding the text control is
necessary using the event binding. Which sizer to lay out depends on
how you expect it to work. Calling Layout() on the grid sizer will
adjust within its existing space, as established during the initial
layout before the text control was added, while calling it on
main_sizer might give the grid sizer itself more room depending on
minimum sizes, and would be closer to what happens with the line 46
approach.
BTW, two small unrelated items. SetAutoLayout() isn't really
necessary as it will be called automatically by SetSizer() - I forget
when that started happening, but it was a while ago. Also, it's not
really a good habit to mix super() and non-super() using classes.
-- David
Thanks.
That seem to do the trick.
Thanks for the SetAutoLayout() tip. The super, non-super was just to
get a quick sample app started.
On Fri, Feb 27, 2009 at 1:41 AM, David Bolen <db3l.net@gmail.com> wrote:
Ritesh Nadhani <riteshn@gmail.com> writes:
Any thoughts what is the diff between line 46 and 47?
http://paste.pocoo.org/show/105695/
Doing 46 shows up the textbox in center but 47 dosnt?
It's probably due to the difference in timing. Using the event
binding you have to wait for the PostEvent to be processed and the
event delivered, which will be after the construction of MyScreen
completes and you return to (or rather, initiate in this case) the
event loop.With 46, the text control is added to the sizer before the frame is
shown (which I believe in turn will cause it to resize its single
child to match its size, thus causing the sizer to re-lay everything
out). With 47, the text control is added after all of that initial
display/layout has occurred.I suspect that calling Layout() again after adding the text control is
necessary using the event binding. Which sizer to lay out depends on
how you expect it to work. Calling Layout() on the grid sizer will
adjust within its existing space, as established during the initial
layout before the text control was added, while calling it on
main_sizer might give the grid sizer itself more room depending on
minimum sizes, and would be closer to what happens with the line 46
approach.BTW, two small unrelated items. SetAutoLayout() isn't really
necessary as it will be called automatically by SetSizer() - I forget
when that started happening, but it was a while ago. Also, it's not
really a good habit to mix super() and non-super() using classes.-- David
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
--
Ritesh
http://www.riteshn.com