[Glade-users] Dynamically adding menu items to menu bar

John Coppens john at jcoppens.com
Thu Feb 19 19:29:32 EST 2009


On Thu, 19 Feb 2009 16:27:15 -0500
Jonathan Lane <lanej at horizon.com> wrote:

> I have a blank menu item in the menu bar named "commands_menuitem" and  
> I want to add a submenu to it with menu items from a configuration  
> file.  But whenever I ask gtk builder for the menu item, it returns a  
> GtkAction.

Hi Jonathan,

I couldn't find any way to make it work with Actions. That is, I managed
to add a GtkAction to the Action group and all, but then I came to the
conclusion that there wasn't an easy way to add it to the menu, which is
separate in the glade file.

I did find an example where the menu is directly built in XML inside the
source file, then read in.

Tristan observed that using the 3.5.7 version of Glade (probably any
3.5.x), Glade can export the GtkBuilder files directly and supports
the 'normal' 'oldie' GtkMenuItems and GtkMenus - no Actions. Then, adding
items was quite a bit easier!

If you can, change to the newer version.

John


More information about the Glade-users mailing list