[Gambas-user] dynamic popup menu, right click

mike webb mwebb at ...1362...
Thu Mar 30 08:54:33 CEST 2006


still havn't figured out this problem, tried reducing the problem by 
simplifing some stuff but it still doesnt work:
what i'm trying to do is catch the "click" event from a dynamicly 
created "right click" popup menu.
in form1 i have these public variables:
PUBLIC rightmenu AS Menu
PUBLIC addmenuitem AS Menu
PUBLIC deletemenuitem AS Menu
PUBLIC editmenuitem AS Menu

in form1 i have created a tableview called tableview1, and this sub:
PUBLIC SUB TableView1_Menu()
    rightmenu = NEW Menu(form1,FALSE)
    editmenuitem = NEW Menu(rightmenu,FALSE)
    addmenuitem = NEW Menu(rightmenu,FALSE)
    deletemenuitem = NEW Menu(rightmenu,FALSE)
    deletemenuitem.Text = "delete a row"
    editmenuitem.Text = "edit a row"
    addmenuitem.Text = "add a row"
    rightmenu.Popup
END

to catch the click event for editmenuitem i have created this sub:
PUBLIC SUB editmenuitem_click()
  message.Info("edit was selected")
END

doesn't work, 
when i right click on tableview1 the menu comes up.
when i select "edit a row" the menu disappears but i can't catch the 
"click" event.
anyone know why ??
has anyone made the right click popup menu work with a dynamicly created 
menu ??





More information about the User mailing list