Re: Gtk::Menu No submenus.



On 5/11/06, Mohammed Sameer <msameer foolab org> wrote:
Hi all,
I'm still a gtkmm newbie.

I'm subclassing Gtk::Window and creating a menubar in the
constructor "see the attached code please".

The menubar is created but it has no sub menus,
Did I hit a bug ? Or am I doing something wrong ?

Attached a code sample:
g++ -o m m.cc `pkg-config gtkmm-2.4 --cflags --libs`


I haven't looked at your example code closely yet, but I would highly
recommend that you look into using UIManager instead of building the
menus manually.  UIManager offers a lot of advantages, including
easily defining a menu structure as an XML tree.  In addition, it
allows you to define menu items in terms of "Actions".  You can then
assign the same action to a toolbar button so that the Open item in
your menu and the Open button on your toolbar will do exactly the same
thing.  Because of this, you can then enable / disable these two
things together, and other things.  I've found it to be very easy to
use.  See this section in the tutorial for information:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch11.html



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