Re: Resetting a Menu by Gene
Gene
Thu Jan 11 11:48:41 CST 2007
Jack Jackson <jacknospam@pebbleridge.com> wrote:
>On Fri, 05 Jan 2007 10:11:10 -0800, Gene Wirchenko <genew@ocis.net>
>wrote:
>
>> For years, my app has set up its menu and then gone merrily
>>along. I now want to have the menu configurable. How do I get the
>>old menuing tossed?
>>
>> If I restart the program after the configuration change, it
>>works. It does not work when I rerun my menu setup code. (The code
>>is executed, and I temporarily see the changes, but when I am back at
>>the read events, the menu is back to as it was before my attempted
>>change.)
>>
>> I have tried set sysmenu to default, set sysmenu nosave, release
>>pad all, and release menus, but none have worked.
>>
>> My basic pattern is
>> set sysmenu automatic
>> set sysmenu to _medit
>> <define pads>
>> <define bars>
>This probably isn't applicable to your situation, but I will describe
>my problem with menu changes not sticking.
It appears to be exactly the same situation that I am running
into. Unfortunately, the no-stick issue with menus is not documented
anywhere that I have seen.
>I have a Top-Level form with a menu. From that form I call a modal
>form (DO FORM xxx WITH Thisform). The second form modifies the menu
>on the first form. As long as I stay in the second form I see the
>changes to the first form's menu. As soon as the second form exits
>the menu reverts back to what it was before the changes.
>
>I was unable to make the changes stick, so I now make the changes
>after the second form returns and that works fine.
My setup is a bit different. Formerly, I set up the menu in my
main program before read events. That worked fine, because the menu
stayed constant. Now that it needs to be modifiable from a form, this
is no longer workable.
I changed my code so that my menu setup code is inside my
application object so it could be called from other places. The first
time, the menu setup sticks. After that, any change does not as soon
as where the menu setup call is returns.
I have considered reverting my menu setup code to the main
program and having any program that changes the setting set a global
and clear events. In the main program, I would set the menu up again
and read events. This is an ugly kludge and will not work right if
there is another form open.
Sincerely,
Gene Wirchenko
Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.