Re: EVT_KILL_FOCUS triggered twice on macOS
Charley Khan <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
On Sunday, July 5, 2020 at 6:42:38 PM UTC-7, Tim Roberts wrote: > > On Jul 5, 2020, at 4:11 PM, Charley Khan <[email protected] <javascript:>> > wrote: > > > Code below sets up two text controls, side by side. > Focus starts in the first one, click in the second one. > EVT_KILL_FOCUS bound to a handler for the first one should trigger as you > click on the second control and it takes focus from the first. > > On Windows (7 and 10), it's only called once, as I'd expect. > On macOS 10.15.5: the editDone handler below is called *twice*. > > Is this a bug? If so -- how do I tell if in wxPython or wxWidgets? > If not, what am I doing wrong? Suggestions appreciated! > > > More of a “quirk” than a bug. It’s almost certainly a MacOS artifact. > Pretty easy to work around. > — > Tim Roberts, [email protected] <javascript:> > Providenza & Boekelheide, Inc. > > Thanks, Tim - appreciate any suggestions; currently working around it just by trying to flag if the handler was "already" called and clearing that bit at a place that was safe. Not a very general or clean solution; is there a smarter/more elegant solution by wrapping or using a synthetic event? -- 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/8c9707b2-cfa4-4d0d-af7b-ca58ad3726e8o%40googlegroups.com.