Michael Gilfix wrote:
Hi all. I just discovered this behavior, which is making life rather
difficult: I have a sizer which contains a progress bar that I want
to display and hide multiple times within a panel. However, it's not
sufficient to just toggle the visibility of the item, because I really
want to be able to toggle the space around it as well.I was hoping to accomplish this using sizer.Prepend (osizer, 0, wxEXPAND)
and then use a sizer.Remove (osizer). This work great the first time and
then prompts the following:Traceback (most recent call last):
File "./libftpcube/ctrlwin.py", line 444, in onTimer
t.updateTransferEstimate ()
File "./libftpcube/ctrlwin.py", line 781, in updateTransferEstimate
self.displayProgressBar ()
File "./libftpcube/ctrlwin.py", line 763, in displayProgressBar
self.sizer.Prepend (self.psizer, 0, wxEXPAND)
File "/usr/local/lib/python2.2/site-packages/wxPython/sizers.py", line 227, in Prepend
elif string.find(args[0].this, 'Sizer') != -1:
File "/usr/local/lib/python2.2/site-packages/wxPython/wx.py", line 1636, in __getattr__
raise wxPyDeadObjectError( self.attrStr % self._name )
wxPython.wx.wxPyDeadObjectError: The C++ part of the wxBoxSizer object has been deleted,
attribute access no longer allowed.In 2.3.2.1, this just causes wxPython to silently crash. Kind of
upsetting.
What's upsetting, that it no longer crashes and tells you exactly what the problem is?
Another hopeful thing was the wxWindows documentation wxSizer.Show
() function. Unfortunately, this doesn't seem to be implemented in
wxPython. That's a shame because it would be really useful about
now.
It was only added about a week ago. It will be in CVS for wxPython too the next time I check in changes.
My final thing is static text wrapping: I really wish there was some
kind of functionality that would wrap text within a given window. Has
anyone tackled this problem? I suppose I could take my message and
write a function to insert '\n' characters before assigning it to the
label. That would be sufficient for my purposes but ugly.
There was some talk about this on wx-dev not too long ago, but I don't remember what was decided. Once the archies are back up you might want to search there and find out.
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!