Re: Drawing outside of an event handler wx.EVT_PAINT
Dietmar Schwertberger <[email protected]> Wed, 9 Dec 2020 18:54:24 +0100
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
On 09.12.2020 12:30, ioprst wrote: > Can you please tell me if there is a correct solution to my problem? Using EVT_PAINT is more future-proof than ClientDC. I would suggest to stick to EVT_PAINT, but optimize things a bit. If your paint routine is expensive, you can save time by painting only the required areas. See the second code example in the documentation at https://wxpython.org/Phoenix/docs/html/wx.PaintEvent.html "You can optimize painting by retrieving the rectangles that have been damaged and only repainting these." For removal of your old cursor, you can call Refresh with the rect argument: Refresh(self, eraseBackground=True, rect=None) So: call Refresh twice, once with the old and once with the new cell rectangle. Regards, Dietmar -- You received this message because you are subscribed to the Google Groups "wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/f477b8f6-2e26-124f-7715-e512281e0387%40schwertberger.de.