Re: How to open a TextView with a fixed width

Dominik Gruntz (gruntz@oberon.ch)
Fri, 9 Oct 1998 20:40:20 +0100

>This might be a trivial question, but I was not able to figure it out.
>
>How can a open a new view in a window with a fixed width ?

If you answer the Properties.SizePref message in your view, then=20
new instances of the view are opened in their preferred size.
Best wishes,
- D. Gruntz, Oberon microsystems AG

MODULE ObxViews0;

IMPORT Views, Ports, Properties;

TYPE View =3D POINTER TO RECORD (Views.View) END;

PROCEDURE (v: View) Restore (f: Views.Frame; l, t, r, b: INTEGER);
BEGIN
f.DrawRect(l, t, r, b, Ports.fill, Ports.red)
END Restore;
=20
PROCEDURE (v: View) HandlePropMsg (VAR msg: Views.PropMessage);
BEGIN
WITH msg: Properties.SizePref DO
IF msg.w =3D Views.undefined THEN msg.w :=3D 60 * Ports.mm =
END;
IF msg.h =3D Views.undefined THEN msg.h :=3D 30 * Ports.mm =
END;
ELSE
END
END HandlePropMsg;

PROCEDURE Deposit*;
VAR v: View;
BEGIN
NEW(v); Views.Deposit(v)
END Deposit;

END ObxViews0.

"ObxViews0.Deposit; StdCmds.Open"