Expand/Shrink

IupSetFocus

Definition: include pGUI.e

IupSetFocus(Ihandle ih)
Description: Sets the interface element that will receive the keyboard focus, i.e., the element that will receive keyboard events.

ih: identifier of the interface element that will receive the keyboard focus. The only elements that can have the keyboard focus are mapped, active, and visible ones, other elements are ignored.
pwa/p2js: Supported.
Notes: The value returned by IupGetFocus is updated only when the main loop regains control and the element actually receive the focus. So were you to call IupGetFocus right after IupSetFocus, the return value would be different (to that just set). You could call IupFlush between the two calls to obtain the updated value.
Auxillary Functions Ihandln next = IupNextField(Ihandle ih)
Ihandln prev = IupPreviousField(Ihandle ih)

Shifts the focus to the next/previous element that can have the focus.
It is relative to the given element and does not depend on the element currently with the focus.

ih: identifier of the interface element.

It will search for the next element first in the children, then in the brothers, then in the uncles and their children, and so on.
This sequence is not the same sequence used by the Tab key, which is dependent on the native system.

Returns: the element that received the focus or NULL if not found.
See Also: IupGetFocus