Re: FVWM: I need 'else' in a function

From: Dominik Vogt <dominik.vogt_at_gmx.de>
Date: Sat, 3 Jun 2000 04:55:53 +0200

On Fri, Jun 02, 2000 at 05:35:00PM -0600, sa_at_space.itacs.to wrote:
> Hello Everone,
>
> I am trying to make a fvwm function, and I need some guidance.
> I want it to raise and move my clock to the center of the
> screen, then move it back when I run the function again. This
> is what I've got right now:
>
> Key c A MC SeeHideFunc "2.1.10*"
> # "2.1.10*" is the title of my clock.
>
> DestroyFunc SeeFunc
> AddToFunc SeeFunc
> + I All ($0) Raise
> + I All ($0) AnimatedMove +44 +44
> + I All ($0) Stick
>
> DestroyFunc HideFunc
> AddToFunc HideFunc
> + I All ($0) Lower
> + I All ($0) AnimatedMove -0 -0
> + I All ($0) Stick
>
> DestroyFunc SeeHideFunc
> AddToFunc SeeHideFunc
> + I All ($0, "!Sticky") HideFunc $0
> + I All ($0, "Sticky") SeeFunc $0
>
> The problem is: SeeHideFunc executes HideFunc AND SeeFunc. Is there a
> way to only execute one? Or is there a better way do write my function?

Remove the line

  + I All ($0) Stick

from the SeeFunc and the HideFunc and add it to SeeHideFunc
instead. Also, I think the syntax of the condition is incorrect.
I think you may not use a comma to separate conditions.

  DestroyFunc SeeFunc
  AddToFunc SeeFunc
  + I All ($0) Raise
  + I All ($0) AnimatedMove +44 +44

  DestroyFunc HideFunc
  AddToFunc HideFunc
  + I All ($0) Lower
  + I All ($0) AnimatedMove -0 -0

  DestroyFunc SeeHideFunc
  AddToFunc SeeHideFunc
  + I All ($0 "!Sticky") HideFunc $0
  + I All ($0 "Sticky") SeeFunc $0
  + I All ($0) Stick

Bye

Dominik ^_^

--
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
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 Sat Jun 03 2000 - 07:16:00 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:50 BST