Alec Flett wrote:

I imagine things is that the AE's could catch this known exception and throw up the alert dialog, and then try re-applying the change. But I heard from Jeffrey that Bryan was concerned about wx eating exceptions, though I don't see how it could in the above simple callstack. Perhaps AEs could complicate that and bring wx into the picture though.

The problem lies in the way we apply edits from text controls: we do it when the user does some action that causes the text control to lose focus.

This normally happens because the user has clicked on some other control, causing it to gain the focus. The focus transition is driven by wx, and as far as I know, there's no way to throw an exception from an EVT_KILL_FOCUS handler that'll stop the focus change (or otherwise allow us to put up an alert to find out what the user wants to do with the edit).

(This isn't just a recurrence problem: we also do our validation at EVT_KILL_FOCUS time, and invalid input in a text control causes us to just put the bogus value back with a "?" appended. This works fine if you're just tabbing around the detail view, but if the loss of focus happened because you clicked on a different item in the calendar or summary panel, you'll never see the "?" and your edit will be lost.)

...Bryan

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to