Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

trouble with combo box

9 views
Skip to first unread message

Tao Li

unread,
Aug 27, 2009, 10:07:21 PM8/27/09
to
Hi guys,

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.


Fred

unread,
Aug 28, 2009, 10:19:29 AM8/28/09
to

Runs fine on the 5 different platforms I tried.

Try clearing your screen's resource base:
xrdb -load
<Ctrl>D

--
Fred K

Tao Li

unread,
Aug 30, 2009, 10:44:32 PM8/30/09
to
It still deson't work. Some of my previous program can't even compile
after doing that.

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.

Tao Li

unread,
Aug 30, 2009, 10:55:51 PM8/30/09
to
By the way, It shows error message like this in one computer.

"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:

arahne

unread,
Aug 31, 2009, 7:04:40 AM8/31/09
to
Tao Li wrote:
> By the way, It shows error message like this in one computer.
>
> "Warning:
> Name: Text
> Class: XmTextField
> Character '\61' not supported in font. Discarded.
> "
>
> Another computer just shows nothing.

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

0 new messages