"Ivan " <firstname.lastname@example.org> wrote in message <email@example.com>...
> Hi everybody!
> I've developed a graphical user interface that contains a couple of editable text fields, and both of them have defined the same callback routine which is only executed in order to check the introduced parameters. When the user introduces incorrect parameters, an error dialog box is displayed with an error message. In my case, when the incorrect parameter corresponds to first editable text field, the error dialog box is correctly displayed, but the (mouse) cursor has move to the second editable text field and I'd like to force it for not moving till the first parameter is correct. Any idea?.
> Thanks a lot. Best regards, Iv?n.
The uicontrol function has an undocumented (well, undocumented only in the help section - it is documented in the doc) feature that if you give it the uicontrol's handle it will move the focus to that control. So, in your callback, simply move the focus back to the offending uicontrol: