Subject: FVWM: How to use Conditional Commands to...

From: Christian Lyra <[email-masked]>
Date: Wed, 28 Aug 2002 10:34:16 -0300

... test for a specific page number? I mean, everytime I enter a specific 
page (lets say 0 1) I want to execute a command, so how can I build a 
function that test for that without using Piperead? It seems to me that the 
built-in conditional commands only matchs windows...

-- 
Christian Lyra
POP-PR - RNP

  Thus spake the master programmer: 
  ``It is time for you to leave.'' 
						The Tao Of Programing
--
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: Mikhael Goikhman <[email-masked]>
Date: Wed, 28 Aug 2002 13:43:25 +0000

> built-in conditional commands only matchs windows...

You don't use conditional commands for this, since this is useless,
You listen to the new_page event using, for example, FvwmEvent.

FvwmBacker may help too depending on what you want to do.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 28 Aug 2002 13:59:39 +0000

> FvwmBacker may help too depending on what you want to do.

A small addition. FvwmBacker has a built-in support for checking for a
specific page, but if you want to use FvwmEvent you do need PipeRead.

Regards,
Mikhael.

---

From: Christian Lyra <[email-masked]>
Date: Wed, 28 Aug 2002 11:06:18 -0300

Thanks!!! FvwmBacker can do exactly what I want!

On Wednesday 28 August 2002 10:59, Mikhael Goikhman wrote:
> > > ... test for a specific page number? I mean, everytime I enter a
> > > specific page (lets say 0 1) I want to execute a command, so how can I
> > > build a function that test for that without using Piperead? It seems to
> > > me that the built-in conditional commands only matchs windows...
> >

-- 
Christian Lyra
POP-PR - RNP

  ``A well-written program is its own heaven; a poorly-written program is its 
own hell.''

---

From: Victor Eijkhout <[email-masked]>
Date: Wed, 28 Aug 2002 13:21:03 -0400

>specific page, but if you want to use FvwmEvent you do need PipeRead.

Checking for what page it is changing to, right? Sometimes I'd like 
to know additionally what page it is changing *from*.

-- 
Victor Eijkhout <[email-masked]>
tel: 865 974 9308 (W), 865 673 6998 (H), 865 974 8296 (F)
http://www.cs.utk.edu/~eijkhout/
--
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: Mikhael Goikhman <[email-masked]>
Date: Wed, 28 Aug 2002 17:58:19 +0000

> to know additionally what page it is changing *from*.

Then you should keep the variable to store the old one.
Something like the following in the event handler function:

  PipeRead ' do something with $[OLD_PAGE_NX] and $[OLD_PAGE_NY] '
  # save the current page for the next event
  SetEnv OLD_PAGE_NX $[page.nx]
  SetEnv OLD_PAGE_NY $[page.ny]

If you really need such non-trivial functionality, you may consider to
write a small module in perl listening to M_NEW_PAGE and doing the work.

Regards,
Mikhael.