How do I auto-update a procedure call ONLY at slider tick marks?

I should probably know how to do this. But I do not remember.

I have a graph with an attached panel. The panel has a slider. The slider has ticks, and the action is set to update with each tick. The call to the slider procedure updates a set of waves AND updates DrawActions on the graph. The issue is likely with how I have implemented the latter. I have this ...

   
    DoWindow/F GraphX
   
    DrawAction/W=GraphX getgroup=Teq, delete, begininsert
    SetDrawEnv/W=GraphX gstart, gname=Teq
    SetDrawEnv/W=GraphX xcoord=MT_iTK, dash=2
    DrawLine/W=GraphX 1/(Tequal+TK), 0.1, 1/(Tequal+TK), 0.45
    SetDrawEnv/W=GraphX gstop
    DrawAction endinsert


The DoWindow/F pulls the focus away from the panel. In my slider control, I have this ...

            if( sa.eventCode & 1 ) // value set
                UpdateCurves()
                FindTSatValues()
                DoWindow/F Inputs
            endif


This should return focus back to the panel. But, it seems that it does not. Or at least not the way that I expect.

I want to return to the panel AND the slider that was the focus. I want to be able to slide through the increments of settings and have the procedure update ONLY at the tick settings.

I imagine one approach is to remove the DrawActions in favor of waves to create vertical lines. That would put them in the UpdateCurves() function and protect them by an implicit PauseUpdate.

Am I missing a cleaner approach?

FWIW, the procedure that I am revising is the Semiconductor Plots Demo.

http://www.igorexchange.com/project/semiconductorconductivity

Sliding through any of the sliders causes the graph to update at each tick mark. But then, you have to re-click on the slider to "unstick" it for the next incremental move.

Got it. I moved the offending call to a "mouse up" section.

            if( sa.eventCode & 1 ) // value set
                UpdateCurves()
            elseif (sa.eventCode & 4 ) // mouse up
                FindTSatValues()
            endif


This does however suggest an slider option ... "Autoupdate only at tick marks"

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
Since you have received and act on our advice to always us /W flags to direct your commands to a window, you shouldn't need the DoWindow/F commands at all. That will just leave the focus in the panel where you want it.

And you might want to use Slider limits={low, high, inc} with inc set to your tick increment.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:
Since you have received and act on our advice to always us /W flags to direct your commands to a window, you shouldn't need the DoWindow/F commands at all. That will just leave the focus in the panel where you want it.


OK. I will try with the DoWindow/F command removed.

--> IT WORKS! Thank you.

johnweeks wrote:
And you might want to use Slider limits={low, high, inc} with inc set to your tick increment.


The slider has limits set during its design, and I am running through a general purpose SliderProc command. My thought on the other option for updating mode is in a different direction, and I probably need to rethink whether it really is useful.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH