From: Alex T. <al...@tw...> - 2006-04-22 14:32:02
|
Winston Wolff wrote: >> There isn't a one-to-one match between the standard wxWidgets/ >> wxPython widget attributes ... The "command" attribute has no >> equivalent in XRC. > > > Yes, the lack of a "command" parameter in an XRC file is a problem. > > The more I fiddle with wxPython, the more I realize how nice > PythonCard is, and how much time it saves. Perhaps a better use of > my effort would be to add Sizers into PythonCard. Apple's Cocoa/ > AppKit has the best sizers in my opinion. What would be the > technical hurdles of adding that to PythonCard? > I'm not real familiar with Cocoa / Appkit / Xcode / Interface Builder - in fact, I've just spent the last ten minutes Googling and browsing around, and that's the sum of my knowledge of them :-) As far as I can see, the Interface Builder approach to resizing is the "rods and springs" style, as in the old Hypercard. This approach I always found easy to use, but it's generally considered less capable than the "sizer" approach. This is particularly relevant for Pythoncard (really, for wxWidgets which underlies PythonCard / wxPython). One big issue in wxPython for cross-platform development is that basic system characteristics (e.g. menu font, button font, button sizes and how much space a button needs, etc.) vary between systems. A "rods and springs" constrained layout can run into problems when even the basic visual features turn out to be larger than they had been in the original layout, and hence the constraints can't necessarily be satisfied prior to stretching, which can result in ugly overlapping components, etc. I haven 't seen a good way to get around that problem, so I eventually had to agree that the sizer approach is the better one - even though it's not as easy to use (or at least, I haven't found a layout editor that makes it easy to use). I think that you can achieve the kind of layout / resizing you want (including x-platform) with the sizers in wxWidgets - BoxSizers and FlexGridSizer get you most of the way, adding GridBagSizer gets you everything else (hopefully once I understand them better, I'll be sure that FlexGridSizer is unnecessary, and that BoxSizers + GridBagSizer is enough). I've been looking, on and off, for a while at adding sizers to the layout editor. So, triggered by your first email on this topic, I've started writing up how I think this could be (simply) done - I'll get that (first draft) out this weekend, and if you're up for it we can perhaps collaborate on it. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.4.5/321 - Release Date: 21/04/2006 |