Xref: utzoo comp.windows.x.motif:2468 comp.windows.x:34975 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ames!dlb!daver!mips!sgi!shinobu!odin!sgihub!dragon!mikey From: mikey@sgi.com (Mike Yang) Newsgroups: comp.windows.x.motif,comp.windows.x Subject: Re: How do I bind multiple functions to a buttonpress? Keywords: Motif, mwmrc, Resources Message-ID: <1991Apr6.165459.11967@dragon.wpd.sgi.com> Date: 6 Apr 91 16:54:59 GMT References: <922@edstip.EDS.COM> <1991Apr5.175019.14043@cs.tcd.ie> Sender: news@dragon.wpd.sgi.com (CNews Account) Organization: Silicon Graphics, Inc. Lines: 18 In article <1991Apr5.175019.14043@cs.tcd.ie> cjmchale@cs.tcd.ie (Ciaran McHale) writes: >In <922@edstip.EDS.COM> kevin@edstip.EDS.COM (Kevin Brown) 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 :-) Be careful. Although the current Xt implementation may call the callbacks for the same event type in order of their binding, the documentation specifically says that the ordering is unspecified. Therefore, if you require a specific ordering, you should add a single callback which performs your operation in the desired sequence. ----------------------------------------------------------------------- Mike Yang Silicon Graphics, Inc. mikey@sgi.com 415/335-1786