Subject: FVWM: FvwmButtons' "hangon"

From: "Tim Freedom" <[email-masked]>
Date: Fri, 29 Jun 2001 15:05:19 -0700

I just came around to playing around with FvwmButtons' "hangon"
feature - it was standard issue back when (ie. the buttons used to
always look pushed-in whenever one pushed 'em a looooong time ago).

I read the man pages, but can't exactly figure how to use it. I get
"/bin/sh: hangon: not found" on stderr whenever I try to insert it
onto my Exec line (in various locations).

I have the following in my .fvwm2rc file

  AddToFunc ToggleNetscape
  +       "I" None (Netscape*) Exec exec netscape
  +       "I" Next (Netscape*) Focus

  # Define the buttons to use.....
  *FvwmButtons Netscape   netscape.xpm   ToggleNetscape

Where do I insert this "hangon" (in between the Exec & exec) to get
the desired affect (please give examples) ???

I'm using fvwm-2.3.33

Thanks

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
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: Dan Espen <[email-masked]>
Date: Fri, 29 Jun 2001 19:02:46 -0400

> "/bin/sh: hangon: not found" on stderr whenever I try to insert it

Well, you don't put the word, "hangon" in the Exec command...

> the desired affect (please give examples) ???

I don't believe you can do what you are trying.

Based on the man page, "hangon" works in 3 different contexts,
Swallow, Panel, and Exec.  But thats "Exec" when interpreted by
FvwmButtons, not within a function started by FvwmButtons.

I suppose you could start Netscape  as a slide out  panel,
that would be:

*FvwmButtons (Panel (up) Netscape ToggleNetscape)

WARNING, none of this is tested, and I'm not much of an
FvwmButtons expert.

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
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: Dominik Vogt <[email-masked]>
Date: Sat, 30 Jun 2001 08:49:22 +0200

> the desired affect (please give examples) ???

Whoa, the documentation is lousy.  I had to read it several times
and cross check it with the code to find out what I had to do.
This works:

  *FvwmButtons(Action Exec "xload" xload)

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [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, 30 Jun 2001 15:12:56 +0000

> WARNING, none of this is tested, and I'm not much of an

This is not an acceptable solution, because:

  * FvwmButtons subpanel is started together with FvwmButtons and is
    hidden until expanded, probably not what Tim wants
  * The possition of subpanel is fixed, you may resize it, but not move
    (the posision is reevaluated after collapsing/expanding)
  * Netscape is not something one estetically wants to put into panel

Here is a solution that works in the latest 2.3.x:

  Style Netscape GrabFocus
  *FvwmButtons: (Icon netscape.xpm, Action `Exec "netscape" exec netscape`)
                                               # ^^^^^^^^^^ <- "hangon"

And optionally you may write bin/netscape wrapper like the one I use:

#-----------8<-----------cut here-----------8<-----------
#!/bin/tcsh -f
# 
# Start a new netscape program if not already lanched, otherwise add
# a new window (optionally with the specified url) to the existing one.
# Tested with Netscape 3, but should work with Netscape 4 too.
# 
# Usage is like for the original netscape: netscape [url] [other-options]

set NETSCAPE = /usr/bin/netscape
set lock = $HOME/.netscape/lock

set OPTIONS=($*:q)  # preserve all original quotes/spaces
if (-l $lock) then
	# remove any stale lock (useful if netscape crashed)
	if (`ps x | grep '[n]etscape ' | wc -l` <= 1) rm $lock
	if ($#OPTIONS == 0 || $OPTIONS[$#OPTIONS]:q =~ [-,+,0-9]*) set OPTIONS=($OPTIONS:q "")
	@ opt_1 = $#OPTIONS - 1
	# don't add -remote if already specified
	if (-l $lock && "$OPTIONS" !~ *-remote*) set OPTIONS=($OPTIONS[1-$opt_1]:q '-remote' 'openURL('$OPTIONS[$#OPTIONS]:q',new-window);')
endif

$NETSCAPE $OPTIONS:q
#-----------8<-----------cut here-----------8<-----------

Regards,
Mikhael.