I am flaili开发者_JAVA百科ng about with wxWidgets, in particular, the wx.Sizer in wxPython. I have read the documents, I have a copy of wXPython in Action before me, and have set aside the problem to work on other things a better mental model of sizers hopefully gestated within my skull. None of this has worked.
I am not grokking, or even getting to the point where I can bang about usefully, how sizers work. In HTML, I could at least set a background color on some div
or td
, or call forth border
s so I could see how things are laid out. Here, I have a grey expanse and no idea which of the nested static box sizers from which it originates. I am giving static box sizers after making a mess out of the grid bag sizers.
Either alternative would let me at least get a handle on how these work.
Although not an answer to your problem, a good way to get a handle on how sizers work is to install Code::Blocks and use the wxSmith plugin to design your interfaces (I believe it is bundled with Code::Blocks). Code::Blocks is available for all major platforms.
wxSmith gives you a real-time view of the sizers you are using by highlighting them with red borders.
As an extra benefit, wxSmith is great for generating GUI code for you instead of doing it by hand.
精彩评论