Question about ComboBox.pls help.

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

Questions about motif? Contact us

2 posts / 0 new
Last post
Question about ComboBox.pls help.

Submitted by dyroro on Mon, 04/18/2005 - 09:58. General Questions
Following is my code.
<br />
#include <Xm/Xm.h><br />
#include <Xm/ComboBox.h></p>
<p>/* the list of colors */<br />
char *colors[] = { "red", "green", "blue", "orange", "purple",<br />
"pink", "white", "black", "yellow" };</p>
<p>main (int argc, char *argv[])<br />
{<br />
Widget toplevel, combo;<br />
XtAppContext app;<br />
Arg args[4];<br />
int count = XtNumber (colors);<br />
int i, n;<br />
XmStringTable str_list;</p>
<p> /* initialize the toolkit */<br />
XtSetLanguageProc (NULL, NULL, NULL);<br />
toplevel = XtVaOpenApplication (&app, "Demos", NULL, 0, &argc, argv, NULL,<br />
sessionShellWidgetClass, NULL);<br />
/* create the List item */<br />
str_list = (XmStringTable) XtMalloc (count * sizeof (XmString *));</p>
<p> for (i = 0; i < count ; i++)<br />
str_list[i] = XmStringCreateLocalized (colors[i]);</p>
<p> /* create the combox */<br />
n = 0;<br />
XtSetArg (args[n], XmNitems, str_list); n++;<br />
XtSetArg (args[n], XmNitemCount, count); n++;<br />
combo = XmCreateDropDownList (toplevel, "combo", args, n);</p>
<p> for (i = 0; i < n; i++)<br />
XmStringFree (str_list[i]);<br />
XtFree ((XtPointer)str_list);</p>
<p> XtManageChild (combo);<br />
XtRealizeWidget (toplevel);<br />
XtAppMainLoop (app);<br />
}<br />

compile is ok.
and ,when I run it.the following warning is out.
<br />
Warning:<br />
Name: Text<br />
Class: XmTextField<br />
Character '\162' not supported in font. Discarded.</p>
<p>Warning:<br />
Name: Text<br />
Class: XmTextField<br />
Character '\145' not supported in font. Discarded.</p>
<p>Warning:<br />
Name: Text<br />
Class: XmTextField<br />
Character '\144' not supported in font. Discarded.<br />
What's wrong?

thx.[/code]

kv2

dyroro wrote:

and ,when I run it.the following warning is out.
<br />
Warning:<br />
Name: Text<br />
Class: XmTextField<br />
Character '\162' not supported in font. Discarded.</p>
<p>Warning:<br />
Name: Text<br />
Class: XmTextField<br />
Character '\145' not supported in font. Discarded.</p>
<p>Warning:<br />
Name: Text<br />
Class: XmTextField<br />
Character '\144' not supported in font. Discarded.<br />
What's wrong?

thx.[/code]

I have compiled and tried it - it worked without any warnings. May be your motif libs compiled with different locale from your system locale, or sort of?