RE: How to create submenus using UIManager

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

 



Emanuele,

I have both static and dynamic menus, and I also wanted to solve
the problem of adding a submenu dynamically, so this is helpful.
The first step was solving the static case.

Have you rewritten the recent-uimanager demo program to use the
GtkRecentAction objects?

Grazie, i ciao.
Stewart



>  Date: Sun, 04 Nov 2007 23:16:54 +0000
>  From: Emmanuele Bassi <ebassi@xxxxxxxxx>
>  Subject: RE: How to create submenus using UIManager
>  To: gtk-list@xxxxxxxxx
>  Message-ID: <1194218214.27081.10.camel@xxxxxxxxx>
>  Content-Type: text/plain
>  
>  
>  On Sun, 2007-11-04 at 15:27 -0500, Stewart Weiss wrote:
>  
>  > I have Emmanuele Bassi's recent-uimanager code and I am trying
>  > to use that as a guide, but it seems absurd to have to go down so
>  > far as to create GObjects just to do this.
>  
>  that code showed how to integrate a pre-existing menu item + sub-menu
>  widget (GtkRecentChooserMenu) with a GtkUIManager; as of GTK+ 2.12 it's
>  not needed anymore, as GtkRecentAction is available exactly for that
>  purpose.
>  
>  if your menu hierarchy is static and you just want to add a menu item
>  with a sub-menu, then just do:
>  
>    <menu>
>      <menuitem .../>
>      <menu>
>        <menuitem .../>
>        <menuitem .../>
>        ...
>      </menu>
>      <menuitem .../>
>      ...
>    </menu>
>  
>  if, on the other hand, your menu hierarchy is dynamically generated, you
>  can either use a placeholder and the switch in/out menu items or you can
>  use a GtkAction subclass that provides a menu item with its own
>  sub-menu, exactly like I did in my recent-uimanager example.
>  
>  my preferences go to the object-oriented approach, because it's cleaner
>  and easier to swap in or out of a project. and creating a new GObject
>  isn't that much work, compared to hooking into a placeholder.
>  
>  ciao,
>   Emmanuele.
>  
>  -- 
>  Emmanuele Bassi,
>  W: http://www.emmanuelebassi.net
>  B: http://log.emmanuelebassi.net

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux