[comp.windows.x] Multiple functions bound to single buttonpress, attempt two

kevin@edstip.EDS.COM (Kevin Brown) (04/10/91)

In response to my original question:

>>Using Motif 1.0 and X11R4, is it possible to bind multiple functions
>>to one button press event.  I know that twm contains a function called
>>f.function, which allows the user to name and create a function.  Is 
>>there an equivalent in Motif?

Ciaran McHale writes:

>Use XtAddCallback() to bind function foo to the ButtonPress event on a
>widget. Then use XtAddCallback() again to bind function bar to the
>widget for the same event type. Guess what? Both functions (foo and bar)
>will be invoked (in order of their binding) when the button is
>pressed in the widget. Amazing, isn't it :-)

Well, I think the question I was trying to ask got misinterpreted.  Let
me try again.  This question has nothing to do with programming in Xt
Intrinsics.  It has to do with Motif resources and the Motif user 
environment.  I am trying to set up a very specific and complicated menu
environment for multiple users.

In the .mwmrc file, a user can define buttonpress and keypress bindings.
The problem I am having is that I wish to bind more than one function
to a buttonpress.  That is, I wish to bind the middle mouse button to more
than one function like f.quit_mwm, f.restart, f.kill, f.move, f.resize, etc.

The problem that created this question was that I want to run the xsetroot
command to set the screen backgroud to solid white before exiting mwm.  
Thus, one of my menus is structured like this:

Menu OperationMenu
{
    "Window Management"	f.title
    "Shuffle Up"	f.circle_up
    "Shuffle Down"	f.circle_down
    "Refresh"		f.refresh
    "Resize"		f.resize
    "Move"		f.move
    "Kill"		f.kill
    no-label		f.separator
    "Restart Mwm"	f.restart
    "Shutdown"		f.quit_mwm
}

For the "Shutdown" command, I tried:

    "Shutdown"		{f.exec "xsetroot -solid white";f.quit_mwm}

    "Shutdown"		{f.exec "xsetroot -solid white"
                         f.quit_mwm}

and many other iterations, none of which worked. The Motif manual states that
a button (or key) can have a (note singular) function bound to it.  I know
the twm supports user defined functions, and they can be bound to keys
using "f.function".  What I need is an equivalent in Motif. 
-- 
 Kevin Brown		    |  kevin@edstip.eds.com
 Electronic Data Systems    |  
 800 Tower Drive	    |  Voice: (313) 265-9232
 Troy, MI 48013 	    |  Fax:   (313) 265-9241