Displaying plots in embedded subwindows & live updating

Hi, I am writing a procedure to take line profiles from an X-ray scattering pattern. I have successfully written the operations for taking linear profiles and radial profiles and have generated a panel with two tabs, one for linear profile and one for radial. Each tab panel has SetVariables for the parameters required for the profiles. This all works fine but there are two things I would like to do;

1) Add a graph embedded in the the area of the first tab for the linear plot and one in the second tab for the radial plot. I do not mind if the way that this needs to be done is to have one graph that is present on both tabs but is updated to display the result depending on which tab I am on. I have done this for the linear plot using this code:

 Display/N=LineProfile/HOST=$PanelName/FG=(FL,*,FR,FB) ImgLineProfile

This creates the graph but using the /FG flag it means that it is displayed relative to the panel not the tab. I guess this can be done using DefineGuide but I'm not really sure how to use that. Obviously I then want to be able to do the same on the second tab.

2) My second problem is that at the moment the Panel I have made has a button linked to a Function x(ctrlName) : ButtonContol procedure which after the variables have been changed remakes the plot. Is there a way I can tell the SetVariable boxes to update automatically when the variables have been changed so I no longer need the update button?

Many thanks,

Tom
RE: /FG flag, I have realised that I can just use the /W flag and specify the exact coordinates so please ignore that part.
Thomas.Dane wrote:

2) My second problem is that at the moment the Panel I have made has a button linked to a Function x(ctrlName) : ButtonContol procedure which after the variables have been changed remakes the plot. Is there a way I can tell the SetVariable boxes to update automatically when the variables have been changed so I no longer need the update button?


Are your SetVariable controls not connected to variables? If they are, when those variables change, then the value displayed in the SetVariable control will also change. But may be you mean that you want the graph to be updated when a user changes the value of a variable in one of the SetVariable controls? If that's the case, then you need to use an action procedure for the SetVariable controls that forces the graph to update when the value is changed by the user.
Thomas.Dane wrote:
This creates the graph but using the /FG flag it means that it is displayed relative to the panel not the tab. I guess this can be done using DefineGuide but I'm not really sure how to use that. Obviously I then want to be able to do the same on the second tab.

I often use guides to control the placement of a subwindow within a tab. It's tricky, but can ultimately save some time fussing with coordinates. To develop such a panel, I generally make a mock-up of the panel and use the interactive methods to create and place the guides. Then I save a recreation macro and copy the relevant code from the macro into my function that builds the panel.

To learn more about the interactive placement of guides, execute this command on Igor's command line:

DisplayHelpTopic "Layout Mode and Guide Tutorial"

If one day you make your panel resizable, the guides can be a big help.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com