Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Notification of a selection in an AsciiText (Athena) widget Message-ID: <9005082013.AA02091@expo.lcs.mit.edu> Date: 8 May 90 20:13:40 GMT References: <3075@goanna.oz.au> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 39 > Is it possible to have a client notified of a selection in an AsciiText widget? Yes. > If so, how would it be done? Read on :-) > I do not want to change the translations as the default ones do exactly what > I want and I would have to include much of the same code in my action > function. You actually do what to change the translations, you need to add a new action routine that is called when there is a valid selection. This action routine can be bound to the same events that trigger the selection. Thus you would modify your translation table to look like this. : extend-end(PRIMARY, CUT_BUFFER0) NotifyNewSelection()\n\ : extend-end(PRIMARY, CUT_BUFFER0) NotifyNewSelection()\ You may have to build some smarts into the NotifyNewSelection routine if you do not want to be notified when the selection is removed (done by clicking button 1 without dragging). > I thought about looking up the default translations in the source code > and then setting up my own translation that includes the default actions > plus my own but I could not find an obvious declaration of the > defaultTranslations for the AsciiText widget. The default translations are in the file TextTr.c Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213