[Gambas-user] dynamic popup menu, right click

mike webb mwebb at ...1362...
Thu Mar 30 14:35:15 CEST 2006


boy i sure understand that i

must assign an event name to your newly created controls
i'm trying that with the sub

PUBLIC SUB editmenuitem_click()
 message.Info("edit was selected")
END


this sub is for the newly created control

PUBLIC editmenuitem AS Menu

notice how i've placed the _click after the control name.
is that not correct ??

the email that you replied with does not have this sub in it, look a the original that i sent, it should be their.






Benoit Minisini wrote:

>On Thursday 30 March 2006 08:54, mike webb wrote:
>  
>
>>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
>>    
>>
>
>You must assign an event name to your newly created controls, as Fabien told 
>you. Otherwise your menu won't raise any event!
>
>Regards,
>
>  
>





More information about the User mailing list