I copied the program directly from motif programming manual 6a, and
compiled it in my two different computer. One computer shows the
combo box and the list, but nothing shows in the combo box when I
click the list. Another computer also shows the combo box, but nothing
is in the list.
The first computer system is ubuntu 6.0XX, the second one is ubuntu
8.10.
The program is like this,
Example 14-1 The simple_combobox.c program
/* simple_combobox.c -- demonstrate the combobox widget */
#include <Xm/Xm.h>
#include <Xm/ComboBox.h>
/* the list of colors */
char *colors[] = { "red", "green", "blue", "orange", "purple",
"pink", "white", "black", "yellow" };
main (int argc, char *argv[])
{
Widget toplevel, combo;
XtAppContext app;
Arg args[4];
int count = XtNumber (colors);
int i, n;
XmStringTable str_list;
/* initialize the toolkit */
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaOpenApplication (&app, "Demos", NULL, 0, &argc,
argv, NULL,
sessionShellWidgetClass,
NULL);
/* create the List items */
str_list = (XmStringTable) XtMalloc (count * sizeof (XmString
*));
for (i = 0; i < count; i++)
str_list[i] = XmStringCreateLocalized (colors[i]);
/* create the combobox */
n = 0;
XtSetArg (args[n], XmNitems, str_list); n++;
XtSetArg (args[n], XmNitemCount, count); n++;
combo = XmCreateDropDownList (toplevel, "combo", args, n);
for (i = 0; i < n; i++)
XmStringFree (str_list[i]);
XtFree ((XtPointer) str_list);
XtManageChild (combo);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}
Could you guys give me any hint on this? feel very frustrated on
this. I feel I couldn't bare with linux any more.
Runs fine on the 5 different platforms I tried.
Try clearing your screen's resource base:
xrdb -load
<Ctrl>D
--
Fred K
I think there is something wrong with my XM/XT/X11 library. I would
like to start a fresh installation using ubuntu 8.1. Could you give
me any suggestion which library I need to install for X11/XT/XM. Thank
you very much.
"Warning:
Name: Text
Class: XmTextField
Character '\61' not supported in font. Discarded.
"
Another computer just shows nothing.
On Aug 28, 9:19 am, Fred <fred.l.kleinschm...@boeing.com> wrote:
This error happens when you have some characters in the text field,
which the currently selected display font does not support.
It is very common if you have UTF-8 encoding in your locale setting.
You can disable UTF-8 encoding by executing
LANG=C
export LANG
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
just before running your application.
Otherwise, the warning is "harmless", in a sense that it won't crash
your application, only the offending characters will be lost.
Dušan Peterc
http://www.arahne.si