Path: utzoo!attcan!uunet!husc6!bloom-beacon!athena.mit.edu!tldavis From: tldavis@athena.mit.edu (Timothy Davis) Newsgroups: comp.windows.x Subject: Re: Athena text widgets Summary: Xaw asciiText widget needs more functionality Message-ID: <6426@bloom-beacon.MIT.EDU> Date: 26 Jul 88 17:40:31 GMT References: <6190@bloom-beacon.MIT.EDU> <5397@eagle.ukc.ac.uk> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: tldavis@athena.mit.edu (Timothy Davis) Organization: Massachusetts Institute of Technology Lines: 39 In article <6190@bloom-beacon.MIT.EDU> Dan Schmidt writes: >I would like to display some text in the [Athena text] widget, and >subsequently change the text from time to time... I use the XtTextBlock definition in , along with a few convenience routines which may or may not be staying around. This worked in the X10 toolkit and seems to be working in my X11 port: XtTextBlock newTextBlock = { 0, 11, "Test String"); XtTextPosition top; XtTextSetLastPos(w, (top=XtTextTopPosition(w))); /* delete the current text */ /* above necessary to get it to work in both X10 and X11 */ XtTextReplace(w,top,top,&newTextBlock); /* would be the only routine required if it worked as advertised */ ---------- I have another problem with the asciiText widget, related to the design of the callback registration mechanism: This widget has no mechanism which I can find to call user callback routines! The simple addition of an XtNcallback callback list, and a Notify action in the actions table which would do XtCallCallbacks() would add much needed functionality. One could grab the contents of a text edit window when the user has filled it in and hit, for example, the RETURN or DO keys. Shouldn't there be a minimum callback functionality for any widget which supports translation management? I would have expected the XtNcallback list to be a part of Core or Simple. I sincerely don't want to have to write a subclass widget of asciiTextWidgetClass in order to add my needed functionality. By the way, I can't get XtAddEventHandler() to register my (second) event handler to a widget either. That's another option to the above. If anyone has a way to make XtAddEventHandler() work for the text widget, please send me sample code. Thanks, Tim Davis Student Courseware Development, MIT