Dear all A quick question on the ability to pass parameters to functions from mathematic GUI in an interactive manner. I am using the GUIKit which offers great functionality for quick GUI interface building. I am trying to call a set of functions by clicking a button which I did and works. In addition I would like to pass parameters to those functions from the same GUI interface via clicking a drop-down menu,a checkbox or radiobutton for example. The idea is that because I have several set of functions and each has different arguments, it is convenient to offer the user the ability to select a set of those parameters to pass for calculations and then click evaluate button. Also note that some functions rely on the output from previous functions which I would like to account for in building the GUI. The problem is I can't figure a way to make the Widget checkbox function to do that. below is my attempts along with some example code
let's say I have three simple functions
add[a_, b_] := sum = a + b;
prod[a_, b_] := product = a*b;
divide[a_, b_] := division = a/b;
Now I wan't to call them using a bottom in a GUI graphical interface :
GUIRunModal[
Widget["Button", {"text" -> "Evaluate!",
BindEvent["action",
Script[Print[add[a, b]]]],
BindEvent["action",
Script[Print[prod[a, b]]]],
BindEvent["action",
Script[Print[divide[product, b]]]]
}
], IncludedScriptContexts -> {$Context}
]
which when providing:
a = 50; b = 5;
Note I pass the output from the prod function ( that is product) as input to the divide function. By running above code you get: ![enter image description here](/c/portal/getImageAttachment?filename=ScreenShot2015-06-12at16.54.32.png&userId=492649)
Now my question is how can I adda checkbox or radio button for each input variable (a,b,c) with a list of possible values to pass to the functions interactively within this GUI interface. The conditions is I want that to be in the same GUI e.g. in a GUIKIt Widget Frame
Many thanks
Hassan