How to restore the toolbar button after pressed?

Whisper.W wrote:

Hi,

I created a tool on toolbar, click it will bring out a new dialog, but
the tool will keep pressed as long as the new dialog open. I noticed in
most applications the New button will restore just after it's pressed.
How can I do this in wxpython?

Instead of opening the dialog immediately in the tool button's event handler, allow it to return to the event loop first (so it can deal with the mouse-up and paint events) and then show your dialog. wx.CallAfter can help you do this.

···

--
Robin Dunn
Software Craftsman