Newbie wxPython (and Python) coder asking four questions on a piece of code

Please make a runnable, small as possible, sample application that demonstrates the problem, and let us know the platform and wx version. MakingSampleApps - wxPyWiki

···

On 7/9/12 7:06 PM, Lars Goldschlager wrote:

Ok, here is my main.py: http://pastebin.com/JFEyYcXy and I want to make
4 questions:

a) How can I keep the lines in the DataPanel from being grown
vertically? (they look like bars right now, not lines!), and if possible
how can I make the first block (first 4 rows) in that panel not take
more than it needs.....

b) After I added and used DataPanel, I can't close the program, without
it hanging, I think it might be mixing self.main_sizer in the class
which I read from the main window, with local only pointers (holders?
variables?) in the class, but I'm unsure....

c) In the DataPanel the four areas in nested GridBagSizers will have a
button to add more "rows" for data entry (copy second row). Is it ok if
I use a list "variable" (holder?) in there to hold the pointers to the
added labels and text fields? or is there a better way? (And if I do
this, to delete a row, do I just unset the pointer and will the Sizer
react on a Layout call? I saw no .Del/Remove method.)

d) Finally, what else did I do stupidly or wrong here? what can I
improve, from a cleaness and "righteousness" standpoint? Please don't
insult me if it's at all possible :slight_smile:

--
Robin Dunn
Software Craftsman