restart: with(Maplets): with(Maplets[Elements]): with(StringTools): #MyDir:="D:\\ASN\\2005\\Day_3\\Buttons\\": MyDir:="": S1:=" Exit ": S2:="Shutdown": IsExit:=false: Change:=proc() global IsExit: if IsExit then Maplets:-Tools:-Set('SE'('caption')=S2) else Maplets:-Tools:-Set('SE'('caption')=S1) end if: IsExit:=not IsExit: end proc: MyPrint:=proc() local result,line: Maplet(onstartup=RunDialog('FD'), FileDialog['FD']( 'title'="Print File",'height'=200, 'onapprove'=Shutdown(['FD']), 'oncancel' = Shutdown() ) ): result:=op(Display(%)): if evalb(result<>NULL) then StringTools[Split](result,"\\")[-1]: Maplets:-Tools:-Set('TF'('value')=%): end if: line := readline(result); while line <> 0 do #print(line); Maplets:-Tools:-Set('TB'('append')=cat(line,"\n")); line := readline(result) end do; end proc: M:=Maplet( Window( title="Maplet Elements", layout=BoxLayout( [BoxRow( BoxCell( Label(Image(cat(MyDir,"colors.gif"))) ) ), BoxRow( BoxCell( Button['SE']('caption'="Shutdown",onclick=Shutdown()) ), BoxCell( Button("Change",onclick=Evaluate(function="Change")) ) ), BoxRow( BoxCell( Button('caption'="Print", 'image'=Image(cat(MyDir,"print.gif")), onclick=Evaluate(function="MyPrint") ) ), BoxCell( TextField['TF'](12) ) ), BoxRow( BoxCell( TextBox[TB](width=26,height=8) ) ) ] ) ) ): Display(M):