retstart: with(Maplets): with(Maplets[Elements]): isExit:=false: isMen:=true: gr:= GridRow( GridCell(Button("1",width=40,onclick=A_Empty)), GridCell(Button("2",width=40,onclick=A_Empty)), GridCell(Button("3",width=40,onclick=A_Empty)), GridCell(Button("4",width=40,onclick=A_Empty)) ): Exit:=proc() global isExit: Maplets:-Tools:-Set(A_E(run)=true): isExit:=true end proc: Men:=proc() global k,gr,isMen: if (k=2) then return end if: Maplets:-Tools:-Set(A_E(run)=true): if (k=4) then isMen:=false end if: k:=k-2: gr:=GridRow( seq( GridCell( Button(cat("",i),width=50,onclick=A_Empty) ), i=1..k) ) end proc: Bol:=proc() global k,gr,isMen: Maplets:-Tools:-Set(A_E(run)=true): isMen:=true: k:=k+2: gr:=GridRow( seq( GridCell( Button(cat("",i),width=50,onclick=A_Empty) ), i=1..k) ) end proc: k:=4: do M:=Maplet[Main](abnormalshutdown="Exit", Window(title="Sizer", menubar=MB_Exit, toolbar=ToolBar( ToolBarButton("",onclick=Evaluate(function=Exit), image=I_Exit,tooltip="Exit") ), layout=GridLayout(inset=5,halign=center, gr, GridRow( GridCell(width=k/2, Button[B_Men]("Меньше",onclick=Evaluate(function=Men), enabled=isMen,font=F_helveticabold14) ), GridCell(width=k/2, Button[B_Bol]("Больше",onclick=Evaluate(function=Bol), font=F_helveticabold14) ) ) ) ), Action[A_Empty](), Action[A_E](Shutdown()), Font[F_helveticabold14]("helvetica",bold,14), Image[I_Exit]("D:/ASN/2005/Day_7/ChangeSize/house.gif"), MenuBar[MB_Exit]( Menu("&File", MenuItem("&Exit",image=I_Exit, onclick=Evaluate(function=Exit)) ) ) ): Display(M): if (isExit or %="Exit" ) then break end if end do: