>>>>> Tim Phipps writes:
T> Is it possible to have a button that does a swallow and have another
T> action tied to the button name?
T> The reason I ask is that I'm trying to set up a cluster monitor panel
T> which is basically nine xloads in a vertical button bar. I have a label
T> for each button with the host name in it and would like to run a terminal
T> on that machine when the button is pressed. I could do it with a button
T> for the xload with a button for the hostname underneath but the geometry
T> gets messy as I only want a small buttons for the names and the xloads
T> to take up the rest of the space. With a combined swallow and label I
T> get this automatically.
T> Cheers,
T> Tim Phipps.
this is a frequently requested feature :-)
this is from my archive:
Date: Mon, 13 May 96 19:50:34 +0200
>>>>> Jens-U H Petersen writes:
J> (Thanks for the new Buttons, Jarl! It's great.)
I can't just add anything to that. (needed some time to find out HOW
powerful it is)
J> Does anyone have a working example of a (mouse) action binding in
J> a swallowed button: I have the following in ".fvwm2rc"
J> ---- Start of included text -----------------------8<--- cut here -------------
J> *FvwmButtons(Swallow(UseOld) "xload1" "Exec xload -font 6x10
J> -background PeachPuff2 -title xload1 -hl yellow -update 5 -scale
J> 2 -geometry -1500-1500 &", Action 'Exec "top_at_clove" xterm -title
J> top_at_clove -e top')
J> ---- End of included text -------------------------8<--- and here -------------
As I see it, your problem is, that once an application is swallowed,
X events are handed to it unfiltered (since it could depend on them -
imagine a swallowed pager, which can't receive any mouse event)
The only example I saw, where an action AND a swallow command was
specified, was Jarls example in the man page.
But that's a swallow with a NOP. (capture existing window, or wait
till a window with that name appears.)
So if no window of that name exists/appears, the "button" is a real
button, which executes the associated action.
If the action starts a window with the long-awaited name, the button
gets REPLACED by the swallowed application, so no more invocations of
the application are possible.
So I don't think it is possible, what you want to do, unless someone
modifies FvwmButtons to intercept events for swallowed applications.
That the return does trigger the action... hmm.
Might be that this is because xload sets the Mwmhints input to false
("I never ever want the keyboard focus." - note: I'm not an X programmer,
I've just been following the discussion here for a long time.)
I just checked:
I can reproduce the xload behaviour.
The action doesn't work, if put on a swallowed perfmeter.
(this does react to keystrokes.)
xbiff also refuses keystrokes, and the action works.
Seem like I guessed right with the motif input hint.
Is there any similar hint for mouse input? (some sort of SkipFocus flag?)
Can we simulate that, or can we just filter the Event stream to the
application without any hint.
J> But the only way that I can run "top" is by pressing the return
J> key on the button (clicking with the mouse does nothing).
J> If instead I put
J> ---- Start of included text -----------------------8<--- cut here -------------
J> *FvwmButtons(Swallow(UseOld) "xload1" "Exec xload -font 6x10
J> -background PeachPuff2 -title xload1 -hl yellow -update 5 -scale
J> 2 -geometry -1500-1500 &", Action(Mouse 1) 'Exec "top_at_clove"
J> xterm -title top_at_clove -e top')
J> ---- End of included text -------------------------8<--- and here -------------
J> Again nothing happens with mouse clicks, but FvwmButtons crashes
J> with some X error when return is pressed.
I got this one:
X Error (intercepted): BadDrawable (invalid Pixmap or Window parameter)
Major Request Code : 62
Minor Request Code : 0
Resource ID (XID) : 31457301
Error Serial Number : 706
Don't know why the generic mouse action does work, and the mouse n doesn't.
J> Also I don't understand why the examples of UseOld in the manual
J> all combine it with NoKill, when "NoKill" is the default anyway,
J> isn't it? Even with UseOld, is I restart fvwm2 a couple of
J> times, it seems to miss xload's, swisswatch regularly :-(
I think Jarl meant NoClose to be used in conjunction with UseOld, in order
to swallow old apps/unswallow them on exit.
But this only works, when I do a "killmodule FvwmButtons" from FvwmTalk.
If I restart Fvwm2, new xbiff/xclock/console/perfmeter are created, while
the old processes are still alive, though they're NOT mapped anywhere.
(And I deleted the -geometry -1500-1500 as well as I set WindowListHit,
ShowMapping, Icon and Title styles.)
hope this triggers some more thoughts.
albrecht
--
Overhead the albatross hangs | And everything is green and submarine
Motionless upon the air | And no one showed us to the land
And deep beneath the rolling waves | And no one knows the wheres or whys
In labyrinths of coral caves | But something stares
The echo of a distant tide | And something tries
Comes willowing across the sand | And starts to climb towards the light
-- Pink Floyd, "Echoes"
--
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 Tue Jun 11 1996 - 03:47:41 BST