Subject: FVWM: A windows automatically close

From: Sam Krishnabhat <[email-masked]>
Date: Mon, 20 Apr 1998 14:53:10 -0700 (PDT)

Hi,

Can I make a window with particular title automatically 'Close' by itself.

For example, I have a window being popped up with title "APPL ERROR" and
I want it to get closed automatically, without me hitting "OK" button.

Can anybody help me with this please.

thanks      i      i
-sam    ..i:i:i..i:i:i..
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Albrecht Kadlec <[email-masked]>
Date: 21 Apr 1998 13:03:02 +0200

> Can anybody help me with this please.

This works for me:

DestroyFunc Do
AddToFunc Do		"I"	$0 $1 $2 $3 $4 $5 $6 $7 $8 $9

*FvwmAudioPlayCmd Do
*FvwmAudio add_window	   'Next ["APPL ERROR"] close'

Module FvwmAudio

if you want some delay, you can replace "I" with an "M" 
-> fvwm awaits the motion timeout and then executes the command.

you can of course also start a shell command via exec, wait any time,
then send the close-command to fvwm via FvwmPipe.
But this is somewhat complicated and might be a bit slower due to the
shell startup.

Did I already tell you, that I do love interpreters ;^)

But wait, this inspired me to expand FvwmAudio into a generic
FvwmEvent module. Will be released soon.

you could also experiment with FvwmAuto, but I don't think you'd get
such a pretty solution.

FvwmAuto man page:

       Module FvwmAuto Timeout [EnterCommand [LeaveCommand]]

...

       EnterCommand  and LeaveCommand are optional.  EnterCommand
       is executed Timeout milliseconds after a window  gets  the
       input focus, LeaveCommand is executed Timeout milliseconds
       after the window has lost focus.

       "Raise" is the default for  EnterCommand,  but  any  fvwm2
       function  is allowed. I would not use "Close" or "Destroy"
       with a low timeout, though.

you could experiment with 

AddToFunction close_if_error "I" Next ["APPL ERROR"] close
(don't know if the "if" command is already implemented and if, then if it's
implemented in your version)

FvwmAuto 0 close_if_error

Plans for combining FvwmAuto and FvwmAudio into one generic module are on
my todo since 1996, but I never got around to it)

-- 
Albrecht Kadlec
---------------
On the outskirts of nowhere,
On the ringroad to somewhere,
On the verge of indecision,
I'll always take the roundabout way.	-- Marillion
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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].