Subject: FVWM: Action from a swallowed button

From: Brian Schroeder <[email-masked]>
Date: Fri, 7 Mar 1997 11:25:54 +1030

I want to swallow an application into a button, but still have that button
launch another application if it is clicked on.  I was under the impression
that that can be done, however it doesn't work for me.  This is an example of
what I am trying to do:

*FvwmButtons (2x1, Swallow "perfmeter"
  'Exec nice -16 perfmeter -g -S -t cpu -t colls -H -bg 908090 -fg navy',
  Action 'Exec "XTerm" xterm -title top -e /usr/local/bin/top&')

Am I trying to do something that can't be done, or am I going about it the
wrong way?

-------------------------------------------------------------------------------
          Brian Schroeder              |
 ,-_|\     [email-masked]           |    Our greatest danger in life is
/     \    Boral Energy Resources Ltd  |   in permitting the  urgent things
\_,-*_/    Adelaide Australia          |      to crowd out the important.
     v     GPO Box 2576 Adelaide 5001  |           CHARLES E. HUMMEL
          PH +61 8 8235 3782           |
-------------------------------------------------------------------------------
--
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: Alan Wild <[email-masked]>
Date: Fri, 7 Mar 1997 00:07:52 -0500

> Am I trying to do something that can't be done, or am I going about it the

Well, yes and no.  TO the best of my knowledge you CAN do what you are
doing, but you have to click on an area of the button that doesn't
belong to the client program. . .ie. run a shaped program and click on
the "background".

It would be nice, however, to tell fvwm buttons to intercept those events
and use them for Actions.  This just isn't possible right now.

-Alan
-- 
Alan Wild <[email-masked]>           /T\ f/s/c lou95
IT-HSC Consultant       Speed School Student Council        Speed News Guy
http://www.spd.louisville.edu/~arwild01 or ==> ~triangle/ ~spdnews/ ~sssc/

---

From: Markus Gutschke <[email-masked]>
Date: 07 Mar 1997 09:52:25 +0100

Brian Schroeder <[email-masked]> writes:
> that that can be done, however it doesn't work for me.

I am uncertain, whether FvwmButton currently supports this feature. If
you cannot get it to work, you could always code it yourself. The
modifications to "perfmeter" should be very simple.

For example code, have a look at my program at
ftp://ftp.franken.de/pub/isnd4linux/contributions/isdnbutton-2.5.tar.gz
(actually, the archive might still reside in ftp://ftp.franken.de/incoming).
This program displays some status information and allows to launch
other programs when you click in the window. It even has a pop-up menu
to select between different programs. The code is not very large and
should serve as a good basis to get started. My code is highly
configurable thru the use of application resources.

Good luck,

Markus

-- 
Markus Gutschke          Internet:       [email-masked]
Schlage 5a               PGP public key: finger -l [email-masked]
D-48268 Greven-Gimbte
Germany                            >>> I prefer encrypted e-mail <<<

---

From: [email-masked] (David S. Goldberg)
Date: 07 Mar 1997 10:32:30 -0500

What you want can be done, but not quite as nicely as you want.  This
has come up before, and my solution was to add an empty title to the
swallowed button.  ISTR someone else saying that the padding feature
can be used the same way.  If you do one of these things, then
clicking on the title, or in the pad area (eg outside the application
window itself) then you get the FvwmButton action you want.  Here is
an example of what I do

*FvwmButtons(10x1, Frame 1, Action `Exec "top" TOP`, \
    Swallow(NoClose,UseOld) XMeter "Exec XMETER", \
    Font SCHU_C_M_R_N_6, Title " ")

So I have a button defined whose default action is to run the top
command (please forgive me for not expanding my M4 macros here).  That
will be run if I click with the mouse button in the title area or if
FvwmButtons has focus and the mouse is positioned in that button, then
hitting RET will cause the action to take place.  In that case, it
doesn't matter where the mouse is in the button.  The Font is an M4
macro for the smallest font I could find on my system so the empty
title takes as little space as possible.  I prefer this to padding
which pads the entire button.  If I click the mouse in the xmeter
title bar, I get the xmeter menu of what stats to display, so in a way
this is the best of both worlds for me anyway.  That said, I'd much
prefer if FvwmButtons allowed me to intercept mouse clicks in
swallowed window buttons in general.  Note also the title is a single
space.  When I tried to use the empty string, FvwmButtons complained.

hth,

--
Dave Goldberg
Post: The Mitre Corporation\MS B305\202 Burlington Rd.\Bedford, MA 01730
Phone: 617-271-3887
Email: [email-masked]

---

From: "Eddy J. Gurney" <[email-masked]>
Date: Fri, 7 Mar 1997 10:48:23 -0500

On Mar 7 at 10:32, David S. Goldberg wrote:
,--
| The Font is an M4
| macro for the smallest font I could find on my system so the empty
| title takes as little space as possible.  I prefer this to padding
| which pads the entire button.
`--
Is it smaller than 'nil2'? 'nil2' is pretty darn small. :-)

Not many people know about that font, which is why I thought I'd mention it.
(and it is short enough to not require an M4 macro... bonus!)

Eddy

---

From: [email-masked] (David S. Goldberg)
Date: 07 Mar 1997 13:13:31 -0500

>>>>> Eddy J Gurney writes:
> Is it [my "small" font] smaller than 'nil2'? 'nil2' is pretty darn
> small. :-)

> Not many people know about that font, which is why I thought I'd
> mention it.  (and it is short enough to not require an M4
> macro... bonus!)

Thanks!  It looks much better now, though I do have to be a bit more
careful about where I put the cursor -- it looks like nil2 give me
about 2 pixels.