restart:
with(Maplets[Tools]): with(Maplets[Elements]): with(plots):
StartEngine();
PlotItWindow:=Maplet(onstartup = RunWindow(MAIN),
Window[MAIN](title="Plot It Window Demo",
[ ["Type in a function of x, and an interval a..b for x."],
["Function:", TextField[func](width=25, background=turquoise)],
["Interval:", TextField[interv](width=25, background=turquoise)],
[Button("Plot It", Evaluate(function = "plotfunc"), background=tan)], #MOD
[Plotter[myplot](width=300, height=300)], #DEL
[Button("Good Bye", Shutdown(), background=pink)] #MOD
]
)
):
,
Window[PlotIt](title="The Plot",
[ [Plotter[myplot](width=300, height=300)],
[Button("Close", CloseWindow(PlotIt), background=pink)]
]
)
[ Button("Plot It", onclick=A1, background=tan),
Button("Good Bye", Shutdown(), background=pink)]
,
Action[A1](RunWindow(PlotIt), Evaluate(function = "plotfunc")
)
plotfunc:=proc()
local userfunc, userinterv, p1;
userfunc:=Get(func::anything):
userinterv:=Get(interv::range):
p1:=plot(userfunc, x=userinterv, thickness=5, color=green);
Set(myplot=p1)
end proc:
Maplets[Display]( PlotItWindow );