There are two points that are not obvious from the standard Obx examples:
how to get a focus container that is in mask mode, and how to set the
focus
of a specific view in this container. The module below demonstrates these
two points. It focuses a control with the label "magic string".
I hope this helps
With best regards
Cuno Pfister
Oberon microsystems, Inc.
MODULE TestNav;
IMPORT Dialog, Views, Containers, Controls, TextModels,
TextControllers;
PROCEDURE Do*;
VAR c: Containers.Controller; rd: TextModels.Reader; v:
Views.View; ctrl: Controls.Control;
BEGIN
c := Containers.Focus();
IF c # NIL THEN
WITH c: TextControllers.Controller DO
rd := c.text.NewReader(NIL);
rd.ReadView(v);
WHILE v # NIL DO
WITH v: Controls.Control DO
IF v.label = "magic
string"
THEN ctrl := v; Dialog.Beep END
ELSE
END;
rd.ReadView(v)
END;
IF ctrl # NIL THEN
c.SetFocus(ctrl)
END
ELSE
END
END
END Do;
END TestNav.
"Set Focus" "" "TestNav.Do" ""