On Thu, Jul 25, 2002 at 01:33:51PM +0200, fvwm wrote:
> On Thu, Jul 25, 2002 at 12:41:55PM +0200, Marcus Lundblad wrote:
> > When using the Menu and Popup commands it's possible to specify a position
> > for the menu.
> > I was wondering if its possible to get an alternative position if the
> > first one isn't possible.
> > For exaplle , I have a menu for icons that normally pops up above the
> > icon, this is good, because normally my icons reside at the bottom of the
> > scrren. But sxometimes I put icons at the top (for various reasons). In
> > this case there is no room for the menu all above the icon, so the menu
> > pops up over the icon (as far up as possible). What I would like in this
> > case is to have a "fall back" so in case the intended position doesn't
> > "work" I coud get a menu to display below the icon.
> > Is this possible?
>
> You can write a shell script and use it with PipeRead:
>
> Mouse 1 I N PipeRead "my_iconmenu.sh WindowMenu $[i.x] $[i.y] $[i.width] $[i.height]"
>
> --------------------------- my_iconmenu.sh -----------------------
> if [[ $3 -lt 500 ]]; then
> echo Menu $1 rectangle "$4"x"$5"+"$2"+"$3" c +100
> else
> echo Menu $1 rectangle "$4"x"$5"+"$2"+"$3" c -100m
> fi
> ------------------------------------------------------------------
Or with the now fixed code in the 2.5 branch:
Mouse 1 I N PipeRead "my_iconmenu.sh WindowMenu $[i.y] $[vp.height]"
--------------------------- my_iconmenu.sh -----------------------
#!/bin/sh
if [ $[$2 + $2] -lt $3 ]; then
echo Menu $1 icon c +100
else
echo Menu $1 icon c -100m
fi
------------------------------------------------------------------
Bye
Dominik ^_^ ^_^
--
Dominik Vogt, mail: dominik.vogt_at_schlund.de, phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Thu Jul 25 2002 - 08:38:54 BST