rendition and rendertable in XmLabel

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

Questions about motif? Contact us

5 posts / 0 new
Last post
rendition and rendertable in XmLabel

Submitted by Anonymous (not verified) on Fri, 06/15/2012 - 12:07

Hi all, i'm very confused on rendertable and rendition.
I want to create a multifont - multicolor label widget, named label1.
I have a code module used to create the label. After i define in resource file the following lines:
*label1.renderTable: bold, oblique
*label1.renderTable.bold.renditionForeground: Green
*label1.renderTable.bold.fontName: *-*-*-bold-*-iso8859-1
*label1.renderTable.bold.fontType: FONT_IS_FONT
*label1.renderTable.oblique.renditionBackground: Red
*label1.renderTable.oblique.renditionForeground: Yellow
*label1.renderTable.oblique.fontName: *-*-*-italic-*-iso8859-1
*label1.renderTable.oblique.fontType: FONT_IS_FONT
*label1.renderTable.oblique.underlineType: AS_IS
*label1.renderTable*tabList: 1in, +1.5in
but the label appears only in green foreground. I want to draw the first half of label in green and the second in yellow foreground.
1) Where i do a mistake?
2) How can i assign a tagged labelstring to label1 (from resourcefile), or a rendition to a labelstring part? For example *label1.labelString: bbbbbbbbboooooooooo where b is bold and o is oblique?
3) Why the tab stops are assigned on a rendition and not on the whole rendertable?
‹ XiCombinationBox Epak Problem XmTextField ... not supported in font. ›

hjwd

Fri, 10/22/2004 - 00:19#1

Why not use 2 separate labels?

Having 2 labels will work just fine so why over complicate things!.

If you link the X & Y co-ordinates of the 2 labels together.
ie.

int label_xpos = 100;

Label 1 : x = label_xpos, y = 200

Label 2 : x = label_xpos + 50, y = 200

frankq

Fri, 10/22/2004 - 08:57#2

rendition and rendertable in XmLabel

For me is impossible to have two labels or more because i set dinamically (runtime) the label values (from catalog messages).

hjwd

Fri, 10/22/2004 - 11:04#3

An array of labels one for each char.

You can define an array of labels, one for each/multiple character(s) if you wish each with a different colour, font and x coordinate.

Then set it like this when you need to...............

for (loop1=0; loop1 < strlen(your_str) - 1; loop1++) {

/* Set label string*/
XmTextSetString(your_motif_label[loop1], your_label_str[loop1]);

} /* end for loop1 */

How about that method?

frankq

Mon, 10/25/2004 - 07:41#4

rendition and rendertable in XmLabel

I'm sorry.
I cannot use this method because i must found a method for which i can set dinamically without code changes, the aspect for ALL the label in my program (at least 10000)