XTkBasicsImpl.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, March 25, 1992 8:59 am PST
Christian Jacobi, March 25, 1992 9:36 am PST
DIRECTORY
XlCursor,
XTk,
XTkFriends,
XTkBasics;
XTkBasicsImpl:
CEDAR
MONITOR
IMPORTS XTk, XTkFriends
EXPORTS XTkBasics ~
BEGIN
inertCursorKey: REF XlCursor.StandardFontCursors ~ NEW[XlCursor.StandardFontCursors ¬ circle];
bareClass: PUBLIC XTk.Class ¬ XTkFriends.CreateClass[[key: $bare, classNameHint: $Bare, cursorKey: inertCursorKey, backgroundKey: $white]];
spaceClass:
PUBLIC XTk.Class ¬ XTkFriends.CreateClass[[key: $space, classNameHint: $Bare, cursorKey: inertCursorKey, backgroundKey: $white]];
Design rationale: bareClass and spaceClass look isomorphic, but in a more fancy toolkit bareClass would generate real widgets with an X window while spaceClass would generate "gadgets".
rulerClass:
PUBLIC XTk.Class ¬ XTkFriends.CreateClass[[key: $rule, classNameHint: $Ruler, cursorKey: inertCursorKey, backgroundKey: $black]];
CreateBare:
PUBLIC
PROC [widgetSpec: XTk.WidgetSpec ¬ []]
RETURNS [XTk.Widget] = {
RETURN [ XTk.CreateWidget[widgetSpec, bareClass] ];
};
CreateSpace:
PUBLIC
PROC [widgetSpec: XTk.WidgetSpec ¬ []]
RETURNS [XTk.Widget] = {
RETURN [ XTk.CreateWidget[widgetSpec, bareClass] ];
};
HSpace:
PUBLIC
PROC [width:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [ CreateSpace[widgetSpec: [geometry: [size: [width: width, height: XTk.dontUse]]]] ];
};
VSpace:
PUBLIC
PROC [height:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [ CreateSpace[widgetSpec: [geometry: [size: [width: XTk.dontUse, height: height]]]] ];
};
CreateRuler:
PUBLIC
PROC [widgetSpec: XTk.WidgetSpec ¬ []]
RETURNS [XTk.Widget] = {
RETURN [ XTk.CreateWidget[widgetSpec, rulerClass] ];
};
HRule:
PUBLIC
PROC [height:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [ CreateRuler[widgetSpec: [geometry: [size: [width: XTk.dontUse, height: height]]]] ];
};
VRule:
PUBLIC
PROC [width:
INT ← 1]
RETURNS [XTk.Widget] = {
RETURN [ CreateRuler[widgetSpec: [geometry: [size: [width: width, height: XTk.dontUse]]]] ];
};
END.