[Gambas-user] Menu changed programmatically

Benoît Minisini gambas at ...1...
Fri Mar 11 13:33:44 CET 2016


Le 11/03/2016 12:47, Rolf-Werner Eilert a écrit :
>
> Am 10.03.2016 18:12, schrieb Rolf-Werner Eilert:
>> How to change the entries of a pop-up menu?
>>
>> I wanted to use a MenuButton like it is used in the Gambas IDE, i. e.
>> not for a menu in the ordinary "menu" sense of the word, but for a list
>> that reacts like a ComboBox.
>>
>> In this case, I would have to abuse the pop-up menu that is linked to
>> the MenuButton. But how can I access the entries of a menu during
>> runtime? I haven't found anything about it in the documentation.
>>
>> Regards
>> Rolf
>>
>>
>>
>
> I know the sources for the IDE must be somewhere... I've been looking
> for them to find out how you realised this thing, but to no avail.
>
> But anyway, can somebody tell me how these two buttons in the IDE are made?
>
> Thanks
> Rolf
>

If you want to make a ComboBox, you don't need a Menu, but the 
ShowPopup() method of the Window class.

Otherwise, a menu is modified through its name. If you define the menu 
name as "mnuOpen", for example, than you get a variable named "mnuOpen" 
pointing at the menu object.

Regards,

-- 
Benoît Minisini




More information about the User mailing list