Subject: FVWM: FvwmButtons: popup on button down?

From: Gregory Margo <[email-masked]>
Date: Wed, 29 Nov 1995 08:00:54 -0800 (PST)

I use a popup menu on the button bar to take my ppp link up/down.
In order to popup the menu, I have to click and release mouse button 1
on the appropriate button.

What I really want is to have the menu popup on a "button down" event,
not "button up", just like the root menus.  Is there any way to do this?

Here are the appropriate sections from .fvwm2rc (2.0.39)

AddToMenu "PPP" "PPP" Title
+              "PPP-up" Exec exec /usr/local/bin/pppup > /dev/console 2>&1 &
+              "PPP-down" Exec exec /usr/local/bin/pppdown > /dev/console 2>&1 &

*FvwmButtons	PPP	calvin2-trans.xpm	Menu "PPP"

If this is an rtfm, let me know and I'll read it more closely.
gm

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gregory H. Margo                 No free speech restrictions on the Internet!
[email-masked]
--
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: [email-masked] (Todd Fries)
Date: Wed, 29 Nov 1995 10:24:42 -0600 (CST)

> *FvwmButtons	PPP	calvin2-trans.xpm	Menu "PPP"

While I don't know about the exact behavior you wish, how about making the
button clickable on the button bar and run a script like this:

*FvwmButtons ....... Exec exec /usr/local/bin/pppup-or-down &

--------/usr/local/bin/pppup-or-down-------------
#!/bin/bash

if [ "`/sbin/ifconfig ppp0 2> /dev/null`" ];
   /usr/local/bin/pppdown 2>&1 > /dev/console
else
  /usr/local/bin/pppup 2>&1 > /dev/console
fi
-------------------------------------------------

Maybe this will come in useful..
-- 
Todd [email-masked]
http://www.cs.umr.edu/~tfries
--
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: <[email-masked]> (Charles Hines)
Date: Wed, 29 Nov 1995 12:54:44 -0500

>>>>> "gm" == Gregory Margo <[email-masked]> writes:

gm> I use a popup menu on the button bar to take my ppp link up/down.
gm> In order to popup the menu, I have to click and release mouse
gm> button 1 on the appropriate button.

gm> What I really want is to have the menu popup on a "button down"
gm> event, not "button up", just like the root menus.  Is there any
gm> way to do this?

gm> Here are the appropriate sections from .fvwm2rc (2.0.39)

gm> AddToMenu "PPP" "PPP" Title
gm> +              "PPP-up" Exec exec /usr/local/bin/pppup > /dev/console 2>&1 &
gm> +              "PPP-down" Exec exec /usr/local/bin/pppdown > /dev/console 2>&1 &

gm> *FvwmButtons        PPP     calvin2-trans.xpm       Menu "PPP"

gm> If this is an rtfm, let me know and I'll read it more closely.

It is, more or less.  Try using 'Popup "PPP"' instead of 'Menu "PPP"'

Chuck

---

From: [email-masked]
Date: Thu, 30 Nov 1995 03:31:27 +0900

gmargo> What I really want is to have the menu popup on a "button
gmargo> down" event, not "button up", just like the root menus.  Is
gmargo> there any way to do this?

See FAQ list which is included in recent fvwm distribution. You can
find what to do :-)

- -
Makoto 'MAR_kun' MATSUSHITA
--
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: Gregory Margo <[email-masked]>
Date: Wed, 29 Nov 1995 11:38:15 -0800 (PST)

> It is, more or less.  Try using 'Popup "PPP"' instead of 'Menu "PPP"'

Both 'Popup "PPP"' and 'Menu "PPP"' act identically.  Both wait for the
button up event.  I tried the following configuration, with nothing
else defined on the button bar.  There was no difference in their
behavior.  Must have to do with the Exec?

*FvwmButtons	PPP	calvin2-trans.xpm	Menu "PPP"
*FvwmButtons	PPP	hobbes-trans.xpm	Popup "PPP"

gm

---

From: <[email-masked]> (Charles Hines)
Date: Wed, 29 Nov 1995 16:43:09 -0500

>> It is, more or less.  Try using 'Popup "PPP"' instead of 'Menu "PPP"'

gm> Both 'Popup "PPP"' and 'Menu "PPP"' act identically.  Both wait
gm> for the button up event.  I tried the following configuration,
gm> with nothing else defined on the button bar.  There was no
gm> difference in their behavior.  Must have to do with the Exec?

gm> *FvwmButtons        PPP     calvin2-trans.xpm       Menu "PPP"
gm> *FvwmButtons        PPP     hobbes-trans.xpm        Popup "PPP"

Ah, silly me.  I just tried this and I see the behavior that you were
referring to...  I wasn't truly thinking when I responded earlier.
The code in FvwmButtons only executes the action specified on a button
release, with no way for the user to change that currently.

A check might be able to be put in the code though, if the action is
"popup" to react on the press instead...let me try that...  Nope that
doesn't work either.  It's popping up the menu via a SendInfo to fvwm,
which doesn't process that until the ButtonRelease (for some reason
that I don't know yet, probably due to the way that the module pipes
are polled).  I have to look over that code some more...

If I can figure out how to do it all correctly, the next patchlevel
will have FvwmButtons react to Popup on the ButtonPress.  If it can't
be done, or is too difficult to be worth it, then I'll post that.

Later,
Chuck

---

From: [email-masked] (Todd Fries)
Date: Wed, 29 Nov 1995 15:31:57 -0600 (CST)

> *FvwmButtons	PPP	hobbes-trans.xpm	Popup "PPP"

A stab in the dark, maybe try something like:

AddToFunc "PPP"
+ "I" Menu "PPP"

*FvwmButtons PPP calvin2-trans.xpm Function "PPP"

or will this do the same thing?