Hello,

I have to close an open menu when the palm goes into sleep because I 
have to redraw some parts of the table when it awakes again. I could not 
figure out how to close a menu correctly.

1st try:
MenuBarPtr MenuePtr = MenuGetActiveMenu();
if (MenuePtr){
        MenuDispose (MenuePtr);
}
Leads into a Error: "Free ptr"


2nd try: Sending a KeyDownevent:
EventType       newEvent;
MemSet( &newEvent, sizeof( EventType ), 0 );
newEvent.eType = keyDownEvent;
newEvent.data.keyDown.chr = '#';
EvtAddEventToQueue (&newEvent); 

Is very errorcausing, even if the screen does not react on that key, it 
causes together with other programs on Treo a awaking of the device.


3rd:
EvtEnqueueKey(vchrMenu, 0, commandKeyMask);
Does not work.


4th:
MenuSetActiveMenu(NULL);
Does not work.


5th:
EventType event;
event.eType   = penDownEvent;
event.penDown = true;
event.screenX = -1;
event.screenY = -1;
EvtAddEventToQueue(&event);
 
event.eType   = penUpEvent;
event.penDown = false;
event.screenX = -1;
event.screenY = -1;
EvtAddEventToQueue(&event);

Does not close the menue fully, but works somehow.


Please it there any other ideas out there?
Best regards
Heinz Aigner

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to