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

From: [email-masked]
Date: Fri, 2 Jun 2000 17:35:00 -0600

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?

Thanks,
sa
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked]
Date: Sat, 3 Jun 2000 04:38:47 -0600

> + I All ($0, "Sticky")    SeeFunc  $0
... 
> way to only execute one? Or is there a better way do write my function?
ok I made it work, here it is FYI.

DestroyFunc SeeHideFunc
AddToFunc SeeHideFunc
+ I All (asclock, Sticky)    SeeFunc
+ I All (asclock, !Sticky)   HideFunc
+ I read $[HOME]/.fvwm/FvwmHideFunc

# ~/.fvwm/FvwmHideFunc contains the same as below

DestroyFunc HideFunc
AddToFunc HideFunc
+ I All (asclock)   Layer 0 2
+ I All (asclock)   AnimatedMove -0 -0
+ I All (asclock)   Stick On

DestroyFunc SeeFunc
AddToFunc SeeFunc   
+ I All (asclock)   Layer 0 10
+ I All (asclock)   AnimatedMove +44 +44
+ I All (asclock)   Stick Off
+ I DestroyFunc HideFunc 
+ I AddToFunc HideFunc I Nop

:-)
sa

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 3 Jun 2000 04:55:53 +0200

> 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

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

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

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked]
Date: Sat, 3 Jun 2000 07:26:31 -0600

>   + I All ($0 "Sticky")    SeeFunc  $0
 
Ahh, thanks this is much better than what I came up with. 

BTW, the man page says:
      All [(conditions)] command
              Execute.  command on all windows meeting the condi<AD>
              tions.   Conditions  are  used  exactly as with the
              Current command.

      Current [(condition...)] command
              Performs command on the currently focused window if
              it  satisfies all conditions.  The contidions are a
              list of keywords from the list below and are  sepa<AD>
              rated  by commas or whitespace. 
                        ^^^^^^
Thanks,
sa
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 4 Jun 2000 02:55:01 +0200

> > On Fri, Jun 02, 2000 at 05:35:00PM -0600, [email-masked] wrote:
[snip]
>               rated  by commas or whitespace. 

Yes.  I wrote that two weeks ago when I noticed that conditions
didn't accept commas.  The first release where this appeared was
2.3.17.

Bye

Dominik ^_^