Hi,
The system I am using for this problem is a 1GHz PIII processor, ATI
Radeon VE graphics card, running Mandrake 8.0 Linux.

I downloaded the file lesstif-0.92.26.tar and built it from source.  To
test it, I took the example from the Motif Programming Manual Volume 6A
about creating a file selection box.  After setting up the required
links to get the application to build, I now get a run-time error:

"Warning: XmManager ClassInitialize: XmeTraitSet failed

Error: attempt to add non-widget child "DropSiteManager" to parent
"readwave_gui" which supports only widgets"

I am not sure how to get around this problem and any help would be
appreciated.  I would have no problems disabling drag-and-drop
completely and build time if that would solve the problem.

Here is the source code in its entirety if it is of any value:

#include        <unistd.h>
#include        <Xm/FileSB.h>

void echo_file(Widget widget, XtPointer client, XtPointer calldata);
extern void exit(int);

void main(int argc, char *argv[], char **envp)
{
XtAppContext    app;
Widget          toplevel, dialog;

XtSetLanguageProc(NULL, NULL, NULL);
toplevel = XtVaAppInitialize(&app, "Test", NULL, 0, &argc, argv, NULL,
NULL);

dialog = XmCreateFileSelectionBox(toplevel, "FileSB", NULL, 0);
XtAddCallback(dialog, XmNcancelCallback, exit, NULL);
XtAddCallback(dialog, XmNokCallback, echo_file, NULL);
XtManageChild(dialog);
XtAppMainLoop(app);
}

void echo_file(Widget widget, XtPointer client, XtPointer calldata)
{
char            *filename;
XmFileSelectionBoxCallbackStruct *cbs =
        (XmFileSelectionBoxCallbackStruct *)calldata;

if (!XmStringGetLtoR(cbs->value, XmFONTLIST_DEFAULT_TAG, &filename))
        return;
if (!*filename) {
        puts("No file selected\n");
        XtFree(filename);
        return;
}
printf("Filename selected = %s\n", filename);
XtFree(filename);
}

Reply via email to