On Ubuntu 11.04 & python-wxgtk2.8 (2.8.11.0-0ubuntu8) when calling SetTransparent in a timer callback, I’m unable to set the window to the desired opacity. It works for me on Win 7/XP and Mac OSX 10.6. Calling SetTransparent outside of a timer also works for me on Ubuntu.
What I’ve tried so far (not shown in the test case), neither of which worked:
using a wx.Timer instead of a wx.PyTimer and manually binding the AlphaCycle handler to the timer event,
creating a custom event class which AlphaCycle posts, the main window has a handler bound to that event which calls self.SetTransparent outside of the timer.
Sorry, no idea. It does work on 10.10, so it must be something related to 11.04. Perhaps transparency can't change after the frame has been shown or something like that. Please create a ticket about it at trac.wxwidgets.org and hopefully one of the GTK experts will know what to do about it.
···
On 5/20/11 4:12 PM, Luke wrote:
On Ubuntu 11.04 & python-wxgtk2.8 (2.8.11.0-0ubuntu8) when calling
SetTransparent in a timer callback, I'm unable to set the window to the
desired opacity. It works for me on Win 7/XP and Mac OSX 10.6. Calling
SetTransparent outside of a timer also works for me on Ubuntu.
What I've tried so far (not shown in the test case), neither of which
worked:
- using a wx.Timer instead of a wx.PyTimer and manually binding the
AlphaCycle handler to the timer event,
- creating a custom event class which AlphaCycle posts, the main window
has a handler bound to that event which calls self.SetTransparent
outside of the timer.
Thanks, I’ll file a ticket. BTW after a bit of playing around, it doesn’t seem to be related to the frame being shown, rather the transparency won’t change after the app.MainLoop is running.