Cursor/M behavior when using window hooks

I call Cursor/M to modify some properties of the cursor without changing it's position (which is also convenient for working with both traces and images, as I don't have to discern between Cursor/I and Cursor). But I noticed the "cursormoved" event in a window hook gets triggered for every cursor (i.e., A,B,C,D ...) on there, even if I only modify just one of them with the command of course. Is this a bug or a feature? Calling Cursor without the /M flag doesn't do this. If the explanation is not clear, I can try to construct an minimal example some time later. I am running Igor 6.34 on Windows 7.
Here's the test code:

Function testwindow()
	make/O testwave = p
	display/N=test01 testwave
	Cursor A testwave 30
	Cursor B testwave 60
	Cursor C testwave 90
	SetWindow test01 hook(MyWindow)=Testhook
End

Function Testhook(s)
	STRUCT WMWinHookStruct &s
	if (s.eventCode == 7)
		print s.cursorname
	endif
End


Executing, for example,
Cursor/M A
after building the window will print
A
B
C
Thanks for the example. Thats really odd as I see multiple unexpected things here:

  1. What is
    Cursor/M A
    supposed to do? You are not changing anything with this call.

  2. The /M flag generates events for all three cursors and not only for the given cursor.



Even if the event should have been named "cursorchanged" instead of "cursormoved" the /M flag should not generate events for other cursors or if you haven't changed anything.

Sounds like a bug for me.

Thomas
Also, there is absolutely no method of determining where the call comes from, as all values stay the same (even the time (ticks); try printing the whole structure and see what I mean).
Regarding 1): Cursor/M could be used to trigger an update in the hook function, precisely without changing the current state.
Cursor/M refreshes all active cursors as a simple way to make sure any changes are made visible.

The running of hook functions is simply a byproduct of the update. It is not designed to trigger a specific cursor hook.

We could add some extra code to update only one cursor - probably would not break anything but you never know....


Larry Hutchinson
WaveMetrics
support@WaveMetrics.com