systemdict begin /notify { (Item: %\n) [ItemValue] dbgprintf } def end /ItemFont Font [] classbegin /new { /new super send begin /ItemDict 100 dict def currentdict end } def /open { % - => font Private begin newprocessgroup make-items ItemDict { 600 0 0 0 /reshape 6 -1 roll send pop } forall /slidemgr [ ItemDict { % key item /ItemCanvas get % ref can MiddleMouseButton % ref can name [4 -1 roll /slideitem cvx] cvx % can name proc DownTransition % can name proc action 4 -1 roll eventmgrinterest % interest } forall ] forkeventmgr def /itemmgr ItemDict forkitems def /paintmgr [ ItemDict { % key item /ItemCanvas get % ref can /Damaged % ref can name [4 -1 roll /paintitem cvx] cvx % can name proc null % can name proc action 4 -1 roll eventmgrinterest % interest } forall ] forkeventmgr def newprocessgroup end % Private /open super send } def /close { Private /itemmgr get killprocessgroup [ItemDict {pop} forall] {ItemDict exch undef} forall /close super send } def /build-char { % char => - Private begin Encoding exch get dup /.notdef eq { pop 0 0 setcharwidth } { ItemDict exch get /i exch def % reparent the item i /ItemParent currentcanvas put i /ItemCanvas get /Parent currentcanvas put i { pause % /foo dbgbreak 0 0 moveto initmatrix currentpoint /move 3 index send /paint exch send } fork pop pop i /ItemWidth get 0 setcharwidth /i null def } ifelse end } def /slideitem { % name => - gsave ItemDict exch get % item ItemDict exch .5 exch % items fillcolor item /moveinteractive exch send % grestore } def /paintitem { % item => - gsave ItemDict exch get % item dup /ItemCanvas get /Retained true put /paint exch send % grestore } def classend def /TestItems ItemFont [] classbegin /Encoding [ 65 /.notdef repeat /radioone /checkone /checktwo /switchitem /eyeitem /movieone /movietwo /moviethree /cycletwo /cyclethree /cyclefour /doitbutton /cancelbutton /nobutton /yesbutton /exclamationbutton /checkbutton /pencilbutton /point0 /point1 /point2 /point2 /point3 /point4 /point5 /tallbutton /negslider /bigslider /nameitem /addressitem /clowntext /tinytext /messages /tableitem counttomark 256 exch sub /.notdef repeat ] def /make-items { /can currentcanvas def ItemDict begin /radioone (Radio) [/panel_choice_off /panel_choice_on] /Left /notify can /new CycleItem send def /checkone (Check one) [/panel_check_off /panel_check_on] /Left /notify can /new CycleItem send dup /LabelY -4 put def /checktwo (Check too!) [/panel_check_off /panel_check_on] /Right /notify can /new CycleItem send dup /LabelY -4 put def /switchitem (Toggle me!) [/toggle1 /toggle2 /toggle3] /Left /notify can /new CycleItem send def /eyeitem () [/eye /eye1 /eye2 /eye3 /eye4 /eye_bld3 /eye_bld2 /eye_bld1] /Left /notify can /new CycleItem send def { /movieone /cycle [/boy1 /boy2 /boy3 /boy4] /Right /notify can /new CycleItem send def /movietwo /cycle [/man1 /man2 /man3 /man4 /man5] /Right /notify can /new CycleItem send def /moviethree /cycle [/horse1 /horse2 /horse3 /horse4 /horse5] /Right /notify can /new CycleItem send dup /ItemFrame 1 put def /cycletwo /cycle [(One) (Two) (Three) (Four) (Five) (Six) (Seven) (Eight) (Nine) (Ten)] /Right /notify can /new CycleItem send def /cyclethree (Mixed cycle:) [ (Look! I can have icons..) /panel_text (..and drawings..) /panel_choice_off (..in cycles!) ] /Right /notify can /new CycleItem send def /cyclefour (Tall Toggle) [/toggle1 /toggle2 /toggle3] /Top /notify can /new CycleItem send def /doitbutton (DoIt!) /notify can /new ButtonItem send dup /ItemBorderColor .5 .5 .5 rgbcolor put def /cancelbutton (Cancel!) /notify can /new ButtonItem send dup /ItemBorderColor .5 .5 .5 rgbcolor put def /nobutton (No) /notify can /new ButtonItem send def /yesbutton (Yes) /notify can /new ButtonItem send def /exclamationbutton /panel_button /notify can /new ButtonItem send dup /ItemBorderColor .5 .5 .5 rgbcolor put def /checkbutton /panel_choose_one /notify can /new ButtonItem send dup /ItemBorderColor .5 .5 .5 rgbcolor put def /pencilbutton /panel_text /notify can /new ButtonItem send dup /ItemBorderColor .5 .5 .5 rgbcolor put def /point0 (Square) /notify can /new ButtonItem send dup begin /ItemRadius 0 def /ItemFrame 6 def end def /point1 (.1 Radius) /notify can /new ButtonItem send dup begin /ItemRadius .1 def /ItemFrame 6 def end def /point2 (.2 Radius) /notify can /new ButtonItem send dup begin /ItemRadius .2 def /ItemFrame 6 def end def /point25 (.25 Radius) /notify can /new ButtonItem send dup begin /ItemRadius .25 def /ItemFrame 6 def end def /point3 (.3 Radius) /notify can /new ButtonItem send dup begin /ItemRadius .3 def /ItemFrame 6 def end def /point4 (.4 Radius) /notify can /new ButtonItem send dup begin /ItemRadius .4 def /ItemFrame 6 def end def /point5 (.5 Radius) /notify can /new ButtonItem send dup begin /ItemRadius .5 def /ItemFrame 6 def end def /tallbutton /panel_choose_many /notify can /new ButtonItem send def /negslider (Slider2:) [-10 +10 0] /Right /notify can /new SliderItem send def /bigslider (Slider1:) [0 255 255] /Right /notify can /new SliderItem send dup /ItemFrame 1 put def /nameitem (Name:) (Iggy Fromme) /Right /notify can /new TextItem send def /addressitem (Address:) (Iggy's place) /Right /notify can /new TextItem send dup /ItemFrame 1 put def /clowntext /clown (Clown) /Bottom /notify can /new TextItem send {/ObjectX ItemBorder neg} /set 2 index send def /tinytext /panel_text (A bunch of tiny text) /Bottom /notify can /new TextItem send { /ItemFont ItemFont .75 scalefont def /ObjectX ItemBorder neg def } 1 index send def /messages /panel_text () /Right {} can /new MessageItem send dup begin /ItemFrame 1 def /ItemBorder 4 def end def /tableitem (Table) [ [(One) (Two) /panel_text] [(Four) (yY|_) (Six)] ] /Bottom /notify can /new ArrayItem send def } pop end % ItemDict } def classend def /I /Item /new TestItems send def /open I send setfont 200 10 moveto (ABCDE) show 2 60 div sleep 100 40 moveto (EDCBAEDCBA) show /win framebuffer /new DefaultWindow send def /reshapefromuser win send /map win send /close I send win /FrameCanvas get setcanvas /open I send setfont 10 10 moveto (ABCDE) show 5 60 div sleep /close I send