
Use SetVariable in panel and in button

jmas340
Macro Fit (a,b) String a,b //Do stuff to $a,$b Execute"PanelTest()") End Function ButtonProc(ba) : Button Control STRUCT WMBButtonAction &ba //do stuff involving setvar0 print setvar0 End Window PanelTest : Panel PauseUpdate; Silent 1 NewPanel /W=(200,100,1140,800) as "Data" ShowTools/A SetVariable setvar0, pos={100,200},size={150,20},title = "StartFreq" //Display some graphs, all generated by IGOR EndMacro
When I compile the macro, the button procedure tells me there is an unknown name or symbol. So how can I pass the variables from the panel through to the function?
The Execute is not needed.
Here:
It is not clear what you intend: you can't just print a setvar by using its name.
Also, what do you want to print, the value of setvar0?
If so, use
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
July 20, 2016 at 11:16 am - Permalink
There is an if/endif section in the button proc to limit the proc to respond to a button click only. There are several other events involving the button that could call the proc... such as the mouse moving over the button.
I made some changes to the code to do this. Hope this helps.
July 20, 2016 at 01:33 pm - Permalink