John Bender wrote:
Hi all,
One would think this code would always work, given a reasonable set of
assumptions, but it's failing in my application:self.next_button.Enable( self.__next_enabled )
assert( self.next_button.Enabled == self.__next_enabled )Can anyone guess what assumptions I'm making that might be false? I
listed the ones I can think of here:
WxPython 2.9 in Windows: button will not Enable() - Stack Overflow
(notably, next_button is defnitely a wx.Button object).One area of concern I have is that this code is already a workaround for
what I believe is a different bug. When I pop open a wx.ProgressBar in a
different function, this button magically becomes disabled. The code
above is merely trying to re-enable it, and it's failing, too. The
button never becomes disabled this way on Ubuntu or Mac, but does on
Windows 7, and it never happened in Wx 2.8.12.1 on Windows, but now does
in Wx 2.9.4.0. However, I still can't imagine how the above code could
ever fail. What am I missing?
I assume you mean a wx.ProgressDialog? If so then the thing that has changed is that wx is now using a different native dialog for this than it was prior to 2.9, and it can be a pain at times and it is not fully compatible with the dialog that was used before.
What is the relationship between the button with the problem and the progress dialog? Do they have a common ancestor? Did the button have the focus when the dialog was shown?
http://wiki.wxpython.org/MakingSampleApps
···
--
Robin Dunn
Software Craftsman