I need to change the property of a window when a button gets pressed. There are enough examples on Wolfram's website, but all they bind the predefined function "Print[]" and I have no problems with binding Print function, but I can't bind something different.
I need call my own function and methods of Widgets.
This is a window whose property I want to change:
widget4 = Widget["TextPanel", {
"preferredSize" ->
Widget["Dimension", {"width" -> 800, "height" -> 660}],
"contentType" -> "text/html",
"editable" -> False, "path" -> html1path}, Name -> "MainOutput"]
functio[]:=(Print["fffff"]);
This is my button:
html2path="some text which I want to change";
butto = Widget["Button", {
"Text" -> "Update",
BindEvent["Action",
Script[ {SetPropertyValue[{"MainOutput", "path"}, html2path] ,
Print["fdfdf"], ref@InvokeMethod[{"Frame", "getX"}], functio[] } ]]
}]
I launch it all together so:
ref = GUIRun[ Widget["Frame", {widget4, butto}, Name -> "Frame" ]];
As result out of all my tries only function Print["fdfdf"] was called.
Output window:
I asked already on
stackexchange. No one seems to know the answer. Someone says it's bug in Mathematica.
I got stuck with it... I only need to bind my own function.