[Gambas-user] Menu changed programmatically

Benoît Minisini gambas at ...1...
Sat Mar 19 17:21:16 CET 2016


Le 14/03/2016 09:07, Rolf-Werner Eilert a écrit :
>
> Yes, but when I first saw this thing, I expected to find a list equal to
> that in a ComboBox, where I can add and delete items during runtime. So,
> if I want this functionality with a menu, I will have to make a menu
> with a given number of items, then change their captions, switch them
> visible on or off, and jump to their Click events in code... Terribly
> roundabout.
>
> I cannot imagine you used it like this in the Gambas IDE, so I asked
> where in the sources I can find it. What I mean is the Open Project and
> Back button. Or are these something completely different?
>
> Regards
> Rolf
>

Then you have to rebuild your menu from scratch each time you need it 
(usually in the Show event of the top-level menu).

It cannot be as flexible as with normal controls because of the way QT 
and GTK+ manage menus internally.

-- 
Benoît Minisini




More information about the User mailing list