FrapMenu menu/item ordering

Brian J. Tarricone bjt23 at cornell.edu
Wed Feb 21 21:41:28 CET 2007


On Wed, 21 Feb 2007 20:19:55 +0100 Jannis Pohlmann wrote:

> On Tue, 20 Feb 2007 17:49:44 -0800, Brian J. Tarricone wrote:
> 
> > How would I do this?  frap_menu_get_menus() and
> > frap_menu_get_items() returns the list of menus and items,
> > respectively, but there doesn't seem to be a way to create a mixed
> > ordering.  So I either end up with all the menus, then all the
> > items, or the reverse, depending on the order I add them in my code.
> 
> True.
[...]
> I know this is a little messy, but it should work. As I don't treat
> menus and items as XML nodes like gnome-menus does, there's no easy
> way to mix them (unless I implement a special node interface).

Would maintaining a separate GList/GSList for the FrapMenuItem order in
each FrapMenu be too much overhead, both speed- and memory-wise?

Keeping the original order is absolutely necessary for a useful menu
implementation, regardless of what the spec says.  If I can't replicate
the current default Xfce menu (more or less), that's a problem.

> <OnlyUnallocated/> only works directly below <Menu> elements, not
> inside <Include>/<Exclude> rules. From my understanding something like
> this should do the job (I actually have something similar in
> my /etc/xdg/menus/applications.menu and it works):
> 
>   ...
>   <Menu>
>     <Name>Other</Name>
>     <Directory>Other.directory</Directory>
>     <OnlyUnallocated/>
>     <Include>
>       <All/>
>     </Include>
>   </Menu>
>   ...

Yep, that worked, thanks.

	-brian




More information about the Xfce4-dev mailing list