I am writing GUI code using GUIKit and in script i need to import/load/call a file(.nb/.m.xml) containing set of expressions and then output after evaluation of these expressions. I have tried (Import / Get / NotebookOpen) but i think i am making mistake somewhere due to which expression is loading and evaluating. here is my code:
GUIRunModal[Widget["Frame", {
"title" -> "Calc with Mathematica",
{Widget["Label", {
"text" -> "First argument:"}],
WidgetAlign[],
Widget["TextField", {
"columns" -> "20",
"horizontalAlignment" -> PropertyValue["RIGHT"],
BindEvent["action",
Script[calculateResults[]]]
}, Name -> "FirstArgumentField"] },
{Widget["Label", {
"text" -> "Second argument:"}],
WidgetAlign[],
Widget["TextField", {
"horizontalAlignment" -> PropertyValue["RIGHT"],
BindEvent["action",
Script[calculateResults[]]]
}, Name -> "SecondArgumentField"]},
{WidgetFill[],
Widget["Button", {"text" -> "Compute",
BindEvent["action",
Script[calculateResults[]]]
}]},
Widget["Label", {"text" -> "Results: "}],
{Widget["Label", {"text" -> "Sum: "}],
WidgetAlign[],
Widget["TextField", {
"horizontalAlignment" -> PropertyValue["RIGHT"],
"editable" -> "false"
}, Name -> "SumField"]},
BindEvent["endModal",
Null
],
Script[
calculateResults[] := Module[{x, y},
{x, y} =
ToExpression /@
PropertyValue[{{"FirstArgumentField",
"SecondArgumentField"}, "text"}];
(* tis contains a having expression in terms of x,y*)
Import["E:\\iiscnew\\PROJECT\\call.xml", "GUIKitXML"];
l = a;
SetPropertyValue[{"SumField", "text"}, ToString[l, InputForm]];
];
]
}
]]
Attachments: