Local win:TGadget = CreateWindow ("win" ,5,5,400,300,Null,WINDOW_MENU+WINDOW_TITLEBAR) ' WindowMenu Local Menu:TGadget = CreateMenu ("Menu 1" ,01,win) Local SubMenu:TGadget = CreateMenu ("Menu S1" ,11,Menu) UpdateWindowMenu(win) ' PopupMenu Local Popup:TGadget = CreateMenu ("Menu Pop",02,win) ' Here ! I have to set Parent to Null !!! Local SubPopup:TGadget = CreateMenu ("UpdateWindowMenu",21,Popup) HideGadget Popup Local Pannel:TGadget=CreatePanel(5,5,380,250,win,PANEL_ACTIVE) Local Event:Int=0 Repeat Event=PollEvent() Select Event Case EVENT_WINDOWCLOSE End Case EVENT_MOUSEUP ; PopupWindowMenu(win,Popup) Case EVENT_MENUACTION Select CurrentEvent.data Case 21 ; UpdateWindowMenu(win) End Select End Select Forever
I think i found the problem
the popupmenu must be created with no parent ( or everything but the window gadget )
replacing
Local Popup:TGadget = CreateMenu ("Menu Pop",02,win)
by
Local Popup:TGadget = CreateMenu ("Menu Pop",02,null)
seems to fix the problem.
It's just I didn't take care about parenting menu to the good gadget ^^