GUIKit Example: Increment Controls
GUIKit Example: Increment Controls
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", {
WidgetGroup[{
Widget["TextField", {
"text" -> "0",
"columns" -> 6,
"horizontalAlignment" -> PropertyValue["Right"], BindEvent["action", Script[
value = ToExpression[PropertyValue[{"textField", "text"}]]
]
]}, Name -> "textField"],
Widget["Button", {
"label" -> "update",
BindEvent["action",
Script[
buttonClicked[]
]
]}],
Widget["CheckBox", {}, Name -> "checkBox"]
}, WidgetLayout -> Row],
Script[
value = 0;
buttonClicked[] := (If[PropertyValue[{"checkBox", "selected"}], value++, value--];
SetPropertyValue[{"textField", "text"}, ToString[value, InputForm]])
]
}];IncrementControlsDialog[] := GUIRunModal[expr];Example
This example demonstrates some simple interaction between user interface controls and some Wolfram Language scripting.
IncrementControlsDialog[]