[Gambas-user] Trouble removing menu item during run time

Willy Raets willy at ...2734...
Sat Dec 1 13:16:56 CET 2012


On Sat, 2012-12-01 at 07:29 +0100, Fabien Bodard wrote:
> Not addonname.index but addonname[index]
> 
> Le 1 déc. 2012 07:28, "Fabien Bodard" <gambas.fr at ...626...> a écrit :
>         Simply tous need to store the menu instance in an array or a
>         collection. 
>         
>         Collection is usefully as you can retrieve menu from a name
>         So in your form header
>         Private $colMenu as new collection 
>         
>         
>         In the menu creation: 
>         ...
>         $colMenu[AddonName.index]=hmenu
>         ...
>         
>         
>         
>         For delete
>         $colMenu[AddonName.index] .delete
>         $colMenu[AddonName.index]=NULL
>         
>         THAT'S ALL :-)

Thank you so much, it works like a charm.
The collection is indeed very useful.

Willy






More information about the User mailing list