Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I was wondering if someone could explain me the code written below (example File Dialog from mathematica). Especially the part with returnValueand InvokeMethod. Also I want to ask how to actually save table from Table Widget(when I add Save button to the widget how to implement the method?). I really need help and any comment is appreciated.

ref = GUIRun[Widget["Panel", {Widget["Button", {"text" -> "Save File...",                    
BindEvent["action",Script[
    Widget["FileDialog", Name -> "saveFileDialog"];
    returnValue = 
     InvokeMethod[{"saveFileDialog", "showSaveDialog"}, Null];
    If[
     returnValue === 
      PropertyValue[{"saveFileDialog", "APPROVE_OPTION"}], 
     PropertyValue[{PropertyValue[{"saveFileDialog", 
         "selectedFile"}], "path"}],
     Null
     ]
    ]]}],
Widget["Button", {"text" -> "Cancel"}]
}] 

]

share|improve this question
1  
If you have any version more recent than v5 you should consider leaving the obsolete GUIkit package behind and using the newer dynamic controls instead. –  Sjoerd C. de Vries Dec 6 '13 at 23:45
    
Ok...I will give it a try :) –  Stefan Dec 7 '13 at 20:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.