ORIGIN '~beta/bifrost/Bifrost';
INCLUDE '~beta/bifrost/private/Impl/debug';
INCLUDE '~beta/bifrost/ColorNames';
-- program: descriptor --
bifrost
(# theWindow: @window
(# theCanvas: @BifrostCanvas
(# aGO: @GraphicalObject;
aSolidColor: @SolidColor;
myShape: @Shape
(#
do (100,100) -> open;
(100,150) -> lineto;
(125,200) -> splineto;
(200,170) -> splineto;
(195,100) -> splineto;
close;
#);
eventhandler::
(#
onOpen::
(#
do aSolidColor.init;
pink -> aSolidColor.name;
aGO.init;
myShape -> aGO.setShape;
aSolidColor[]-> aGO.setpaint;
aGO[] -> draw;
aGO[] -> hilite;
#);
onMouseDown::
close;
#);
eventhandler::
(#
onOpen::
(#
do aSolidColor.init;
pink -> aSolidColor.name;
aGO.init;
myShape -> aGO.setShape;
aSolidColor[]-> aGO.setpaint;
aGO[] -> draw;
aGO[] -> hilite;
#);
onMouseDown::
(# exactPos: ^point;
do mousePos -> DeviceToCanvas -> mousePos;
(aGO[], mousePos)-> HitControl -> exactpos[];
(if exactpos[] <> NONE then
aGO[] -> unhilite;
(aGO[], exactPos, NoModifier)
-> interactiveReshape;
aGO[] -> hilite;
else
(if (theCanvas[],mousePos) -> aGO.containsPoint then
aGO[] -> unhilite;
(aGO[], mousePos, NoModifier)
-> interactiveMove;
aGO[] -> hilite;
if);
if);
#);
onKeyDown:: (# do terminate #);
#);
open::
(# do theWindow.size->size; #);
#);
open::
(# do (300,300)->size; theCanvas.open; #);
#);
do theWindow.open;
#)
Mjølner System: Bifrost - Tutorial.
Mjølner System: Bifrost - Reference Manual.