DIRECTORY Commander, IO, Rope, XTkWidgets; X11TilingDemo: CEDAR PROGRAM IMPORTS Commander, IO, XTkWidgets = BEGIN 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. ๘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 สฎ•NewlineDelimiter –(cedarcode) style˜codešœ™Kšœ ฯeœ=™HKšœ<™