![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Create a text box that contains a statement or statements, with no input required.
![](/sites/default/files/styles/thumbnail/public/ssmith911/profile-images/2018-08/ScottSmith-Headshot.jpg?itok=9JkNzMXg)
ssmith911
Function BuildDataTable(CtrlName):ButtonControl
String CtrlName
variable pts
Prompt Pts, "Number of Test Points:"
DoPrompt "Enter number of Points", pts
Make/D/O/N=(pts) FlowSet, FlowAct, TimedVol, TimeSecs, VolMeas, VolDry
Edit/N=DataTable Flowset; appendtotable FlowAct; Appendtotable TimedVol; Appendtotable TimeSecs;
END
So after the tables appears I want a window, similar to a "Prompt" window, to say something like "Please enter the test data in the following columns". With a button that will kill the window after its been read. Then the user enters data into each of the waves. DoPrompt wants to have some pulldowns or data entry and that is not needed here. Im sure I just dont know the command name for this. Thanks for the help.
ssmith
DoAlert
.By the way, when you include Igor code please enclose the code in <igor> and </igor> tags so that it gets properly syntax-colored.
For example, your code becomes...
November 6, 2017 at 11:37 am - Permalink
November 6, 2017 at 01:18 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 6, 2017 at 02:52 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 6, 2017 at 02:53 pm - Permalink
November 7, 2017 at 07:31 am - Permalink
A control panel is an Igor window with user-programmed GUI. For your application, you need a pretty simple one: a button for "Done", a button for "Cancel" and possibly a TitleBox control with a message to the user.
Your example acts the way it does because PauseForUser prevents interaction with any window other than the table until the table window is killed. But there is no provision for killing the window that is accessible to the user (that is, you). Hence, the need for a control panel that has a button that will either accept the changes or cancel the changes and then kill the main PauseForUser window. Here is a very simple example that illustrates what I was describing:
Copy that code, paste into the Procedure window, then close the Procedure window. To run the example, execute Example() on Igor's command line. You will see a pair of badly-placed windows (the panel shouldn't really lie on top of the table) that allows you to edit the table or click the buttons in the panel, and nothing else. The action procedures for the panel buttons (AcceptButtonProc() and CancelButtonProc()) kill the windows. The panel is the PauseForUser main window, and when it is killed PauseForUser returns and the function stops executing. Killing the table isn't required, but you indicated that it should be temporary.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 7, 2017 at 09:41 am - Permalink
Thanks for the example. While walking back from lunch it dawned on me that I could use case statements that are selected via the buttons in a panel to do the different things I want. I was thinking the PauseForUser command had some sort of built in method to pause execution and then resume without much programming and that I was missing it. This example helps a lot.Thanks for taking the time to whip it up for me.
ssmith
November 7, 2017 at 10:31 am - Permalink
IS there a reason that the fPausePanel is described at the end and not in the beginning? Why do you use EndMacro instead of just End at the of the fPausePanel function? Your use of the STRUCT command is something I've never seen as well as the ba.eventcode. If you have time can you explain how these operate. I think I can get this to work with my more rudmentary IGOR skills and CASE statements. Thanks again for the help.
ssmith
November 7, 2017 at 10:46 am - Permalink
I prefer the two-step approach for three reasons:
1. PauseForUser is a tricky beast both from the Igor programmer's point of view (i.e., you) and in terms of its internal implementation in Igor
2. The two-step approach is simpler to program and to understand
3. The user is free to do whatever he wants between step 1 and step 2 and can use any tools that Igor provides *
* For example, the user can use the help system, search for text, put cursors on a graph, activate another window to copy and paste into the table, ....... In the PauseForUser method, the user can do only what the PauseForUser panel allows him to do.
November 7, 2017 at 09:44 pm - Permalink
The order of the functions is not important.
The EndMacro instead of just End is a bit of sloppiness on my part- I mocked up the panel manually, saved a recreation macro, and then converted the macro into a function. I forgot to change that last line. As you can see, Igor's compiler tolerates that small inconsistency.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 8, 2017 at 09:07 am - Permalink
November 8, 2017 at 01:22 pm - Permalink
Thanks for the help. I took your suggestion and user DoAlert at the end of a function to provide info on how to proceed. I am using buttons in a controll panel to execute the functions in the proper order.
November 8, 2017 at 01:32 pm - Permalink
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
November 8, 2017 at 08:28 pm - Permalink
Yes that is exactly what I meant. Thanks for the info.
ssmith
November 9, 2017 at 05:40 am - Permalink