Re: FVWM: A windows automatically close

From: Albrecht Kadlec <albrecht_at_auto.tuwien.ac.at>
Date: 21 Apr 1998 13:03:02 +0200

Sam Krishnabhat <samk_at_cisco.com> writes:

> 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.


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 majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Apr 22 1998 - 09:58:40 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:01 BST