Top Document: Motif FAQ (Part 4 of 9) Previous Document: 97) How can I highlight text in the Text widget? Next Document: 99) Can I customize the pointer cursor or insert position indicator See reader questions & answers on this topic! - Help others by sharing your knowledge So that some initial text is displayed, but anything typed replaces it. [Last modified: July 95] Answer: XmTextSetSelection(Text1, 0, XmTextGetLastPosition(Text1), event- >xbutton.time); where Text1 is the widget in question (obviously) and event is some event that triggered this call. You can use XtLastTimestampProcessed( display) instead of xbutton.time if you don't happen to have an event pointer handy. Jon A. Christopher (jac8792@tam2000.tamu.edu) writes: I have had difficulty getting this to work as described (even though it agrees with the documentation). I believe that it may be because I usually change the TextField to some value and then try to select it. I haven't looked at the internals of the TextField widget, but it must only select the text if the text hasn't changed since the time specified. Ususally the "LastTimestampProcessed" will be be *before* you modify the text, and the selection is therefore ignored. I'd suggest using the CurrentTime variable. This is an X variable which, if used will make sure that your text is always selected. User Contributions:Top Document: Motif FAQ (Part 4 of 9) Previous Document: 97) How can I highlight text in the Text widget? Next Document: 99) Can I customize the pointer cursor or insert position indicator Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page [ Usenet FAQs | Web FAQs | Documents | RFC Index ] Send corrections/additions to the FAQ Maintainer: kenton@rahul.net (Ken Lee)
Last Update March 27 2014 @ 02:11 PM
|
Comment about this article, ask questions, or add new information about this topic: