FrapMenu menu/item ordering

Jannis Pohlmann jannis at xfce.org
Thu Feb 22 09:39:19 CET 2007


On Thu, 22 Feb 2007 09:05:16 +0100, Stephan Arts wrote:

> On 2/21/07, Brian J. Tarricone <bjt23 at cornell.edu> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Wed, 21 Feb 2007 20:42:36 +0100 Stefan Stuhr wrote:
> >
> > > ons, 21 02 2007 kl. 20:19 +0100, skrev Jannis Pohlmann:
> > > > They're unsorted as the order is unimportant for internal use.
> > > > Comparing them by names is really easy with the help of a
> > > > GCompareFunc as you can see above.
> > >
> > > I will admit that I don't know the fd.org menu standard, but if
> > > the implementation in GNOME follows the standard (I do believe
> > > that it does), then the order does matter - and not necessary a
> > > sorted order.
> >
> > Agreed.  If FrapMenu can't preserve the order from the .menu file,
> > that's a *huge* limitation.  How will people make menus with
> > arbitrarily-ordered items?
>
> Sorry to disappoint you there, but the XML standard does not force
> siblings to be entered in a specific order. As such, there is no XML
> parser which will guarantee you that xml-nodes are returned in the
> order they come up in the file. And they do not have too, it is not
> part of XML-spec itself.

Uh, that's kind of wrong. How would a <Layout> element work if the XML
file would not be walked from top to the bottom? How would
<Include>/<Exclude> elements work? XML elements are parsed in order.

Anyway, menu items are not XML at all. They're just files spread over
several directories and - as we all know - there's no way to e.g.
switch two file "positions".

> As a consequence of this, it is impossible for FrapMenu (or any other
> application which uses XML) to preserve the order since it is not even
> certain that the order in which the nodes are presented to him is the
> order in which they where inside the file.

See above. Keeping the XML node order is not the problem.

  - Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20070222/1c3d83c3/attachment.pgp>


More information about the Xfce4-dev mailing list