Text alignment in menus

Hi everyone,

Fist, sorry if my english doesn’t “sound” well…

Then, I’m trying to align text in my menus.
For example, 3 items in a menu :
A Thing >
BC Other >
DEF Another thing >
I’d like to have the 3 three words “Thing”, “Other” and “Another” in the same alignment.
I thought that I should use ItemFormat with some %l placed well, but I couldn’t find the correct way with the command AddToMenu to get the result I’m looking for !
However, the FVWM man page says :

But I don’t understand at all how this idea of “columns” works !
If anyone could help,
thanks in advance

A simple example:

MenuStyle "*" ItemFormat "%.5|%.4r%.|%.4s"

First token: “%.5|”, more correct would be “%0.5|”. Meaning:

  • %| is a side delimiter, there are one of these to the left and another to the right as you can see. This is an empty space where nothing is drawn. This implies that is you set an Active colorset it will not fill this area, and you will get a margin here :wink:

-The number 0.5 means that from the place where the delimiter is set, you count 0 pixels to the left and 5 to the right (I can’t think of any usefull end for this feature in %|, but it is usefull with some other symbols). As you see if the value is zero there is no need to put it.

Second token: “%.4r”, more correct would be “%0.4r”. Meaning:

-%r means “text aligned to the right”, and “l” would mean “to the left”.

-The number means again the same. You can leave some margin around the text to the left or right. In this case the margin is 0 to the left (anyway we had some margin from the previoius token :wink: ) and 4 to the right.

Third token: “%.|”, more correct would be “%0.0|”. Meaning:

-%|, already explained above.

-. or 0.0, means no margins to the left or to the right. Anyway, we have some margin to the right in the previous token (4).

Fourth token: “%.4s”, more correct would be “%0.4s”. Meaning:

-%s means sidebar. It has to be the first or last token (not hard to think why).

-0.4 means no margin to the left and 4 pixels margin to the right. The margin to the right will be a little 4 pixels line that will extend to the right of the sidebar (which is to the right of the menu) and will be filled with the same background of the menu (does not matter if it is a normal colorset, a gradient or whatever).

Well, I hope this cleared something out. If not ask again.

  • Cheers. :wink:

Thank you very much for that long post full of explanations concerning ItemFormat (especialy for %s).
But, that doesn’t solve, infortunately, my problem !
Indeed, in this command :

ItemFormat "%.4s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|"

there is this sequence (%.5l%.5l%.5r).
Maybe I’m wrong, but I think that it means that it is possible to have three columns of text aligned as wanted. If so, I’d like to know the line in my menu config to obtain that alignment, such as :

AddToMenu <menu> + ???????????????????????????????

If it’s just the text – then you’re going to want to use ‘%space’ and ‘%tab’
to align them properly – although within a set field-length, this is going to
be slightly annoying, I’d have said.

This has nothing to do with what you’re trying to achieve.

– Thomas Adam

Well, I found it !
I wanted to obtain alignments in my menus like, for example, here.
My problem was to find the way to separate the differents fields in my AddToMenu commands…
And the answer is so simple :

[code]AddToMenu

  • %img.png%“Whatever in the first field____whatever in the secondfield …” Exec exec Stuff[/code]
    where ____ is a real tab !!!
    Thanks again for your answers and comments.