Durand wrote:
Ok, I tried what you suggested and came up with this:
http://pastebin.ca/1218144 However, the problem is that it does work
here...(self.Update() isn't needed) I guess you guys have helped me enough
already...
That's the idea -- now you need to add stuff back in until the problem
shows up again.
By the way, it's easier to just enclose the code with your post -- one
less step for folks to try it out for you.
> Well, there is actually a space
> next to the list in the sample code which is not in the full program
> and I have no idea why...
Actually, for me, on OS-X, with wxPython 2.8.9.1, the layout is a mess, and I can't tell what it should be.
A couple comments:
I'd stay away form exec() it's dangerous and fragile -- it also muddles up the distinction between code and data:
for widget in hidden_widgets:
exec("extra_opts_options_sizer.Add(self.%s)"%(widget))
could be:
# in __init__
hidden_widgets = [self.save_stats_opts_activate,
self.save_stats_opts_destroy]
then:
# in __do__layout
for widget in hidden_widgets:
extra_opts_options_sizer.Add(widget)
Things are getting pretty nested:
self.main_opts = wx.Notebook(self, -1, style=0)
# Notebook Panes
self.main_opts_pane = wx.Panel(self.main_opts, -1)
self.extra_opts_pane = wx.Panel(self.main_opts,-1)
self.extra_options_listbox = wx.ListBox(self.extra_opts_pane, -1, choices=["Option"])
so you've got a Frame with a Notebook on it, and a couple Panels in that Notebook.
What I'd do is make each of those Panels a separate class. You might also want to make the notebook a separate class.
That way, you can test each panel by itself, and you won't get as confused about what is the parent of what.
Take a look at:
http://wxpython.org/codeguidelines.php
and
http://wiki.wxpython.org/wxPython%20Style%20Guide
for style guidelines. It will help make your code cleaner and more readable.
Ok, another question, is this mailing list on google groups?
I don't think so, but it is on gmane, that might be easier for you.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov