Re: Menubar items created in a loop



Hello Vlad,
I was thinking about this solution, but I hoped there is some cleaner way of doing it.

So I guess I will just use this approach.

Thank you anyway

On Sun, Mar 1, 2009 at 10:13 PM, Vlad Volodin <vest 84 gmail com> wrote:
Hello Adam

I'm not sure about the solution. You can look at my sources, where I use loop and UIManager for building dynamic menus.  The function is the next one:
Gtk::Menu* MainWindow::BuildBgSubmenu ()
I hope it might help you.

Sincerely,
Vlad Volodin


2009/3/2 Adam Kovari <kovariadam gmail com>
Hello,
i am unable to find any documentation or examples for creating menu items in loop.
This approach creates nothing and gives no error.

    Glib::RefPtr<Gtk::UIManager> m_refUIManager;
    Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
while(...)
        m_refActionGroup->get_action("Connect")->create("aaa");

    m_refUIManager = Gtk::UIManager::create();
    m_refUIManager->insert_action_group(m_refActionGroup);

refActionGroup contains some other menus and there is xml containing its UI definition
m_refUIManager->add_ui_from_file("MainWindow.MenuBar.ui.xml");

Can you please provide me with some example code?

Thanks in advance
--
---
Adam Kovari(mailto:kovariadam gmail com)

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list





--
---
Adam Kovari(mailto:kovariadam gmail com)
Sent from: Bratislava  Slovakia.

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