Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

Motif FAQ (Part 4 of 9)
Section - 97) How can I highlight text in the Text widget?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Part8 - Part9 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Schools ]


Top Document: Motif FAQ (Part 4 of 9)
Previous Document: 96) How can I get the correct colors for scrolled text widget
Next Document: 98) How can I select all of the text in a widget programmatically?
See reader questions & answers on this topic! - Help others by sharing your knowledge

Answer: argv@zipcode.com (Dan Heller) wrote:

If you don't need font or color changes, you can do all this using a Text
widget very easily [in Motif 1.1, anyway].

loop() {
    pos = offset_of_pattern_in_text_widget(pattern, text_w);
    search_len = strlen(pattern);
    XmTextSetHighlight(text_w, pos, pos+search_len,
                XmHIGHLIGHT_SELECTED);
}


There are two choices for highlighting: reverse video (HIGHLIGHT_SELECTED) and
underlined (HIGHLIGHT_SECONDARY_SELECTED).  Be careful that your users won't
confuse your highlights with actual selections!

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




Top Document: Motif FAQ (Part 4 of 9)
Previous Document: 96) How can I get the correct colors for scrolled text widget
Next Document: 98) How can I select all of the text in a widget programmatically?

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