Subject: FVWM: automatic cursor movement with fvwm buttons?

From: Jim Cline <[email-masked]>
Date: Sat, 5 Mar 2005 11:57:18 -0500 (EST)

Hi, I have a question which I could not find the answer to from reading 
the man pages or FAQ's.

I have fvwm buttons which pop up applications in xterm windows, and I 
would like the cursor to automatically move into the window when it has 
been spawned rather than staying on top of the button.  If it were 
possible to have two actions associated with a button (the first to pop up 
the window, the second to execute a CursorMove command) I would know how
to do this, but apparently that's not possible.  There must be another way 
which I'm not seeing.

regards, Jim
([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: Mikhael Goikhman <[email-masked]>
Date: Sat, 5 Mar 2005 17:39:07 +0000

> to do this, but apparently that's not possible.  There must be another way 

See FAQ 3.18. One of several possible listed suggestions is:

  DestroyFunc StartXTerm
  AddToFunc   StartXTerm
  + I Exec xterm -name "my favorite options"
  + I Wait XTerm
  + I Next (XTerm) WarpToWindow 50 10p

Regards,
Mikhael.

---

From: Tavis Ormandy <[email-masked]>
Date: Sat, 5 Mar 2005 18:35:01 +0000

On Sat, Mar 05, 2005 at 11:57:18AM -0500, Jim Cline wrote:
> If it were possible to have two actions associated with a button 
> (the first to pop up the window, the second to execute a CursorMove
> command) I would know how to do this, but apparently that's not possible.
> There must be another way  which I'm not seeing.

You're on the right track, instead of binding it to Exec foo, bind it to
a function that does all the actions you require, eg:

AddToFunc MyExecFunc 
+ I Exec $0
+ I Wait $0
+ I Next ($0) WarpToWindow 50 50

Now you can use MyExecFunc xterm, instead of Exec xterm or whatever :) 

-- 
-------------------------------------
[email-masked] | finger me for my gpg key.
-------------------------------------------------------
--
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: Sun, 6 Mar 2005 07:18:49 +0000

On 05 Mar 2005 18:57:05 -0500, Jim Cline wrote:
> 
> Hi Mikhael,
> 
> I tried your suggestion, putting this into my .fvwm2rc:
> 
> DestroyFunc StartPineXTerm
> AddToFunc   StartPineXTerm
> + I Exec xterm -name "-bg green -fg black -geometry 120x30-75+80 -e 
> /usr/bin/pine -p /home/jcline/.pinerc-mcgill &"
> + I Wait XTerm
> + I Next (XTerm) WarpToWindow 50 50
> 
> and defining the corresponding button using
> 
> *FvwmButtons(1x2, Title pinem Icon mailbox.xpm Action 'StartPineXTerm')

Add commas before Icon and Action, so it is more readable and correct.

> However it only creates the xterm and does not execute the command 
> specified by the -e argument.  Do you see what the problem might be?

The xterm command line syntax is incorrect, it should be:

  Exec xterm -bg green -fg black -geometry 120x30-75+80 -e /usr/bin/pine -p /home/jcline/.pinerc-mcgill

Ampersand is redundant. Please ask questions on the list, not privately.

Regards,
Mikhael.