Re: UIManager and dynamic menus



On Wed, 2007-04-04 at 17:21 -0500, Paul Davis wrote:

> In other news, how did you set up your ui_info string that you pass to
> Gtk::UIManager::add_ui_from_string() ; ?
> 
> If I don't do something like this:
> 
>         "       <menu action='ViewMenu'>"
>         "           <menuitem action='ViewDefaultSize' />"
>         "           <menuitem action='ViewFullScreen' />"
>         "           <separator />"
>         "           <menu action='ViewWindowsMenu'>"
>         "               <menuitem action='TestItem' />"
>         "           </menu>"
>         "       </menu>"
> 
> If I don't have a menuitem in the 'ViewWindowsMenu' then it doesn't
> show up at all.  I tried calling show() on it and everything, but I
> have the sneaking suspicion that its just not added to the parent menu
> till you add a child.

i load menus from a file, but yes, i found much the same problem.

> Perhaps we might think about trying to add some better dynamic
> functionality to this in the future when we're planning an API/ABI
> break, but it just doesn't seem worth it right now.

i actually really like the Menu_Helpers API. the main benefit for me
from UIManager is defining menus in external text files, which
Menu_Helpers doesn't provide.

--p





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]