[gtkada] How to interrupt the Focus out <-> Focus in event mechanism

Emmanuel Briot briot at ACT-Europe.FR
Mon Aug 27 11:07:56 CEST 2001


Rabbix het Netwerkkeun writes:
 > I have an entry field that listens to Focus Out events. Depending on
 > some criterion, I want to disallow the user to Focus Out this entry field
 > until some valid value is entered. My current solution is as follows:

This doesn't sound very user-friendly, since this means that the user can not
for instance switch to another page if your entry field is in a notebook, to
get the information required to fill the field.
The protocol is generally to either:
  - check was is in the entry field when the dialog is closed, and ask again if
    the information is invalid
  - or, if possible, check after each key_press_event that the new character is
    valid.

Otherwise, to answer your specific question, I indeed don't think it is
possible to interrupt the focus_in/focus_out sequence, since indeed the
focus_out is raised by the new widget that just received the focus.

Maybe you could try to connect your main window or dialog to the set_focus
signal, there might be something there.

Emmanuel




More information about the gtkada mailing list