X11TilingDemo.mesa
Copyright Ó 1989, 1990, 1991 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, February 6, 1989 5:54:29 pm PST
Christian Jacobi, August 14, 1991 3:40 pm PDT
Willie-s, November 25, 1991 4:49 pm PST
DIRECTORY Commander, IO, Rope, XTkWidgets;
X11TilingDemo:
CEDAR
PROGRAM
IMPORTS Commander, IO, XTkWidgets =
Widget: TYPE = XTkWidgets.Widget;
depth: INT ¬ 8;
forDebugging: Widget;
CreateDemoWidget: Commander.CommandProc = {
idx: INT ¬ 0;
CreateTile:
PROC [i:
INT, h:
BOOL]
RETURNS [w: Widget] = {
IF i<=0
THEN {
w ¬ XTkWidgets.CreateLabel[
widgetSpec: [geometry: [borderWidth: 1]],
text: IO.PutFR1["w %g", IO.int[idx ¬ idx+1]]
];
}
ELSE {
w1: Widget ¬ CreateTile[i-1, ~h];
w2: Widget ¬ CreateTile[i-1, ~h];
IF h
THEN w ¬ XTkWidgets.CreateXStack[[], LIST[w1, w2], 0]
ELSE w ¬ XTkWidgets.CreateYStack[[], LIST[w1, w2], 0];
};
};
top: Widget ¬ forDebugging ¬ XTkWidgets.CreateShell[windowHeader: "tiling monster", standardMigration: TRUE];
w: Widget ¬ CreateTile[depth, TRUE];
XTkWidgets.SetShellChild[top, w];
XTkWidgets.RealizeShell[top];
};
Commander.Register["X11TilingDemo", CreateDemoWidget, "Create tiling demo widget"];
END.