Slider won't move continuously in IgorPro 7

When the following is run in Igor 6, the slider can be grabbed and continuously moved (updating images in panel). In Igor 7, I can click a point in the range of the slider and it will move there, but it won't perform continuous motion. It just sticks in one place after click.

Function SliderProc_3(sa) : SliderControl
    STRUCT WMSliderAction &sa

    switch( sa.eventCode )
        case -1: // control being killed
            break
        default:
            if( sa.eventCode & 1 ) // value set
               
                Variable curval = sa.curval
                setactivesubwindow BGPanel
                setactivesubwindow #OImage
                ModifyImage Om ctab= {0,curval,Grays,1}
                setactivesubwindow BGPanel
                setactivesubwindow #EImage
                ModifyImage Em ctab= {0,curval,Grays,1}
                setactivesubwindow BGPanel
            endif
            break
    endswitch

    return 0
End


Here is the corresponding Panel code:

        Slider SetOriginalScale,pos={6,338},size={300,50},proc=SliderProc_3
    Slider SetOriginalScale,help={"Image Scale"},labelBack=(56576,56576,56576)
    Slider SetOriginalScale,fSize=10
    Slider SetOriginalScale,limits={0,255,0},value= 98.8586956521739,vert= 0,thumbColor= (0,65280,0)


Have you tried setting Slider SetOriginalScale live=1? Accordig to documetation this should be the default though.
If you click in the slider control channel, but not in the slider thumb, it jumps to the place you clicked, but does not follow further mouse movement.

If you click in the thumb, you can drag the thumb and the control will follow the mouse movement.

This is true in both Igor 6 and 7.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Hi Thomas,

Still no continuous motion with inclusion of Slider SetOriginalScale, live=1
Hi John,

In my case "If you click in the thumb, you can drag the thumb and the control will follow the mouse movement." does not perform as you note for Igor7, but does in Igor6, for the above noted code.

Clayton
I just noticed that your event handler makes several calls to SetActiveSubwindow. My guess is that is causing the problem in Igor 7. Instead of call SetActiveSubwindow, use the /W flag with ModifyImage, like this (perhaps):
Function SliderProc_3(sa) : SliderControl
    STRUCT WMSliderAction &sa
 
    switch( sa.eventCode )
        case -1: // control being killed
            break
        default:
            if( sa.eventCode & 1 ) // value set
 
                Variable curval = sa.curval
                ModifyImage/W= BGPanel#OImage Om ctab= {0,curval,Grays,1}
                ModifyImage/W= BGPanel#EImage Em ctab= {0,curval,Grays,1}
            endif
            break
    endswitch
 
    return 0
End

I put a lot of effort into making window activation work correctly in Igor 7, but there are some things that simply are different.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com