Clearing Empty User Defined Hook Functions?

I have coding that essentially does the following:

    switch(how)
        case -1:    // clear all
            SetWindow $cw hook(MyHookA)=$""
            SetWindow $pn hook(MyHookA)=$""
            SetWindow $cw hook(MyHookB)=$""
            SetWindow $pn hook(MyHookB)=$""
            break          
        case 0: // set A active
            SetWindow $cw hook(MyHookA)=MyHookAFunction
            SetWindow $pn hook(MyHookA)=MyHookAFunction
            SetWindow $cw hook(MyHookB)=$""
            SetWindow $pn hook(MyHookB)=$""
            break
        case 1: // set B active
            SetWindow $cw hook(MyHookA)=$""
            SetWindow $pn hook(MyHookA)=$""
            SetWindow $cw hook(MyHookB)=MyHookBFunction
            SetWindow $pn hook(MyHookB)=MyHookBFunction
            break
    endswitch


The hooks are attached to a panel that is external to a graph and to the graph. I notice, when I save the experiment and then reopen it, I get a compilation error. Essentially, the panel window recreation line contains code ...

      SetWindow kwTopWin, hook(MyHookA)=MyPanel#
      SetWindow kwTopWin, hook(MyHookB)=MyPanel#


This causes the experiment recreation to bomb.

So, how do I clear the user defined hooks and not leave empty traces of them in the window recreation macro for the experiment?
I think an answer is best arrived at by sending in an example experiment that demonstrates the problem to support@wavemetrics.com.

My initial bet is that there's a bug in how Igor fixes up hook function names in an independent module (is that what "MyPanel" is?

In other words, I suspect you really have

#pragma independentModule=MyPanel
...
SetWindow $cw hook(MyHookA)=$""


You'll also help by pointing out which version of Igor you're using.

Software Engineer, WaveMetrics, Inc.
JimProuty wrote:
I think an answer is best arrived at by sending in an example experiment that demonstrates the problem to support@wavemetrics.com. ...


Will do. Thanks!

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
[For the record, this turned out to be a bug in Igor 6 that'll be fixed for 6.11. The bug happens only in an independent module.]

Software Engineer, WaveMetrics, Inc.