Xref: utzoo comp.windows.news:2507 comp.windows.open-look:389 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!lll-winken!sun-barr!newstop!exodus!bendenweyr!flar From: flar@bendenweyr.Eng.Sun.COM (Jim Graham) Newsgroups: comp.windows.news,comp.windows.open-look Subject: Re: a problem with tNt Message-ID: <5879@exodus.Eng.Sun.COM> Date: 14 Jan 91 21:28:01 GMT References: Sender: news@exodus.Eng.Sun.COM Reply-To: flar@bendenweyr.Eng.Sun.COM (Jim Graham) Followup-To: comp.windows.news Distribution: comp Organization: Sun Microsystems, Inc. Lines: 29 In OpenWindows 2.0 (NeWS version 2.1), you have to set the /Synchronous flag on interests whose associated actions modify the event propagation strategy. The reason for this is that all events are now delivered immediately upon generation unlike previous versions of NeWS which would only deliver events once per cycle through the process dispatcher. So, if the up event is generated while your PS code is still trying to express the interest in that event, the event could pass you right by. To solve this, make the interest in the downtransition Synchronous (see your NeWS 2.1 programming guide for more information). Then, when the downtransition is delivered, the input queue is automatically blocked until you unblock it, thereby holding the uptransition from being delivered until you are ready for it (i.e. have expressed interest in it). |> /MakeInterests { |> /MakeInterests super send |> /LeftMouseButton {pop /movefromuser } |> /DownTransition Canvas MakeInterest dup /Synchronous true put % add this line |> } def Then, in the /movefromuser method, put an unblockinputqueue after the code which creates the /Uptransition interest and expresses it. In general try to put the code which modifies event propagation (maps canvases or expresses or revokes interests) as early in your event handling code as possible and then unblock the input queue as soon as you can to avoid holding up event propagation any more than you have to. ...jim