Hi All,
> I think this might be a bit of a bug in the ToasterBox's
"Play" function.
> It seems to create a timer regardless of the closing style that is
> defined
Yes, it is a bug indeed.
>
> Seems like the 5 lines regarding the Timer in Play() should
be wrapped
> up like this
>
> if self._closingstyle == TB_ONTIME:
> timerid = wx.NewId()
> self.showtime = wx.Timer(self, timerid)
> self.showtime.Start(self._pausetime)
> self.Bind(wx.EVT_TIMER, self.NotifyTimer, id=timerid)
>
This should be the correct implementation. However, it does crash in any case with the previous error message. I implemented ToasterBox quite a long ago (I believe I was using wxPython 2.5), and I never tried to run it from a different thread. For me it's just a small whistle & bell addition to wxPython, and I use it only to notify for software upgrades or similar. I recognize that for more intense messaging, it's not well suited.
> However the "TB_ONCLICK" closing style doesn't appear to be
working properly for me either.
Uhm, it works for me. There are problems in using this style when coupled with the TB_COMPLEX style, because you can add as many widgets as you want to the ToasterBox, and if you click on any of those widget, the click event is not propagated to the parent frame (usual problem with wxWidgets). The only possibility here is to make ToasterBox bind all the widgets' wx.EVT_LEFT_DOWN event and to propagate this event to the parent frame.
Yea, there are a few bugs I've corrected with the corner
placement in there as well.
Would you mind contributing it back, as a patch or something similar? In this way I could update my web page with the new version.
The main issue I have is that the popups lock up
the main gui and I'm not sure why it should, especially after
seeing that it running on a timer should be a sort of threading.
The lockup can get pretty bad in my app. It displays updates
from remote subversion repositories using pysvn and if you
have more than one repository the lag is pretty bad.
During implementation, I used wxTimer because it was the easiest and cleanest solution for my purposes. However, if you come up with a nicer implementation, I would be glad to have a patch and to integrate it in a new version.
Andrea.
···
_________________________________________
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London
Direct Tel: +44 (0) 20 717 08936
Mobile Tel: +44 (0) 77 487 70534
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯