How can I highlight a portion of text in a Label Widget ?

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
How can I highlight a portion of text in a Label Widget ?

Submitted by Anonymous (not verified) on

Fri, 06/15/2012 - 12:07

Hello.
Please help me, because I am stuck in this problem. I searched all over the net, but I couldn't figure out how can I do such a thing. Actually, I saw the XmStringDraw function, which probably could do such a thing. But it isn't well documented and a few examples is what I found.
Bottom of line, I want to be able to put a text which has different colors (from this point I stopped thinking about XmText widget), has underlined words and also highlighted words. The text is read only, so I thought that a label widget is the way. Wrong :( If in a XmText I can highlight words, in a XmLabel I can't. If in a XmLabel I can use coumpound strings (XmString) and thus been able to set different colors in text, in a XmText I can't. So I really have to reach to a compromise, and somehow concatenate these two widgets.
Can you please give me an idea how to do this? And I don't think that I have to start creating a new widget, probably because I don't have such a time and also I'm thinking that there may be a simple solution (which I'm totally missing :(( )
Thank you for reading this
‹ X and Y coordinates become default(0) after XtManageChildren Transparent XPM Pixmap in Motif Widget ›

 

Mon, 11/28/2005 - 08:42#1

Mon, 11/28/2005 - 08:42#1

Submitted by yahubat on

Tue, 07/17/2012 - 10:25

Mon, 11/28/2005 - 08:42#1

Dvorak

How can I highlight a portion of text in a Label Widget ?

I resolved this thing, using a XmDrawingArea and drawing on it the text with XmStringDrawImage.