Problems about XtOpenDisplay

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

Questions about motif? Contact us

3 posts / 0 new
Last post
Problems about XtOpenDisplay

 

I got a problem when try to move my progarm form solaris to linux..

here is the code in solaris,it will read the file "Xmfc" when running.
But it seems cannot read when running in linux!!
i really want to know why?

#include
#include
#include

Display *display;
XtAppContext context;
Widget toplevel,manager,exit_button;
...

int main(int argc, char **argv){

....

XtToolkitInitialize();
context = XtCreateApplicationContext;

strcpy(dpy,":0.0");
display = XtOpenDisplay( context, dpy, NULL, "Xmfc", NULL, 0, &argc, argv );

toplevel = XtAppCreateShell( NULL, NULL, applicationShellWidgetClass, display, NULL,0 );

manager = XtCreateWidget( "manager", xmBulletinBoardWidgetClass, toplevel, NULL, 0 );

XtManageChild(manager);
XtRealizeWidget(toplevel);
.....
XtAppMainLoop(context);
return 0;
}

 

 

There can ba any number of

There can ba any number of problems. Where is the file? What are its permissions? What are the permissions of its directory and up?

It can also depend on environment settings, such as whether you have an environment variable RESOURCE_MANAGER set, or XUSERFILESEARCHPATH, or XAPPLRESDIR, etc.

try setting:
export XENVIRONMENT=Xmfc

where Xmfc is in the directory from which you execute your program.

 

 

 

fredk .Thank you very much

fredk .Thank you very much for your advice.It's very helpful.
"XAPPLRESDIR=." is the answer

thanks again!!