Answered Question on menu and sub menu handle

Hello,

A question, I made popup menu in Browse widget:
I code it that way in the RIGHT-MOUSE-DOWN trigger:

Code:
DEFINE VARIABLE myMenu AS HANDLE NO-UNDO.
DEFINE VARIABLE myItem AS HANDLE NO-UNDO.

IF AVAILABLE TT1 THEN DO: /* Where TT1 is a temp-table in the browse open-query */
    CREATE MENU myMenu ASSIGN
        FONT = 3
        POPUP-ONLY = TRUE.
        
    CREATE MENU-ITEM myItem ASSIGN
        SUBTYPE = 'normal':U
        PARENT = myMenu
        LABEL = "INFO"
        TRIGGERS:
            MESSAGE "HELLO"  .
        END TRIGGERS.

      SELF:POPUP-MENU = myMenu .

END.

I assumed that after leaving the trigger the handle myMenu doesn't exist.
But because I put it in the SELF:pOPUP-MENU handle he is still available.
So do I need to delete the handle myMenu before created it again ?

Best Regard,

BobyIsProgress
 

Osborne

Active Member
It has been a long time since I used CREATE MENU-ITEM but think once created it is always available even if created in a trigger/internal procedure.

So either delete or remove from the relevant widget:
Code:
SELF:POPUP-MENU = ?.
 
Top