GUIKit Example: RealTimePlotting
GUIKit Example: RealTimePlotting
The functionality provided by GUIKit has been superseded by the interface construction and controls functions native to the built-in Wolfram Language.
Needs["GUIKit`"]expr = Widget["Panel", {
{Widget["Label", {"text" -> "a:"}],
Widget["Slider", {
BindEvent["change",
Script[sliderFunc[];]]}, Name -> "slider",
WidgetLayout -> {"Stretching" -> {Maximize, False}}]},
Widget["MathPanel", {"preferredSize" -> Widget["Dimension", {"width" -> 288, "height" -> 288}]}, Name -> "canvas",
WidgetLayout -> {"Stretching" -> {True, Maximize}}], Widget["TextArea", {"text" -> "Plot[Sin[x]^a,{x,0,2Pi}]",
"rows" -> 3}, Name -> "textarea"],
"preferredSize" -> Widget["Dimension", {"width" -> 288, "height" -> 340}],
BindEvent["componentResized", Script[sliderFunc[];]],
Script[
sliderFunc[] := Block[{a, $DisplayFunction = Identity}, val = ToExpression[PropertyValue[{"slider", "value"}]];
a = Round[(val/10)];
expr = ToExpression[PropertyValue[{"textarea", "text"}]];expr = Show[expr, PlotRange -> All];
SetPropertyValue[{"canvas", "mathCommand"}, ToString[expr, InputForm]] ];
sliderFunc[];]
}];RealTimePlotting[] := GUIRunModal[expr];Example
Here is an implementation of the J/Link RealTimePlotting example written with the GUIKit` package.
RealTimePlotting[]