python - Why is wxGlade enforcing a sizer as the first child for wx.Frame? -


i notice wxglade (gui builder wxpython) enforcing sizer first child element wx.frame seems odd me since every book , tutorial out there suggests use wx.panel first child element.

so if want have wx.panel base gui (for example have consistent default background color on windows) have go:

wx.frame -> sizer (1,1) -> wx.panel -> sizer (x,x) -> content 

instead of

wx.frame -> wx.panel -> content 

out of curiosity can explain design decision me?

according robin dunn, creator of wxpython:

personally i've been doing frame-sizer-panel-sizer lately because frame.fit() let sizer calculate min size needed instead of using panel's current size. if don't use fit or similar , there 1 child of frame there isn't other reason need sizer on frame frame automatically fit panel frame's client area. - https://groups.google.com/forum/#!searchin/wxpython-users/frame$20sizer$20panel/wxpython-users/nw5nivkfu7m/-1isbryvvjyj

another handy reason use frame -> sizer -> panel makes switching panels easier in can hide panel , show another. see tutorial more information.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -