Quoting Ba la <[EMAIL PROTECTED]>:

> Hi Mark,
>         I am opening two displays using
> XtOpenDisplay()
> function call after that I am creating two shells
> using XtAppCreateShell(), in that my first function
> XtAppCreateShell() succeeds, but the second function
> call to create shell using XtAppCreateShell fails and
> dumps the core, the parameters  diff is the 1st
> parameter app_name and the 4th parameter Display(what
> I got from XtOpenDisplay) remaining all same, I didn't
> find any syntax error in that 2nd call, then how come
> it is getting fails ???, (I am working in 8bpp mode)
> 
>   I am in the process of finding out the error, can
> you give me some hints!!!! on this issue.
> 
>   my questions are,
> ** out of two createshell functions one is succeeds
> other fails, is it really error with
> XtAppCreateSheel() function call or some errors with
> XtOpenDisplay itself, 
> ** is ther anyway to check whether the XtOpenDisplay
> function executed properly and the display is opened
> for funther operation like that.

  Hi,

  I just wrote this small test program, and it seens to work:
--
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>

XtAppContext appcon;
Widget shell1, shell2;
Display *display1, *display2;

int
main(int argc, char *argv[])
{
    Arg args[2];
    Cardinal num_args;

    XtToolkitInitialize();

    num_args = 0;
    XtSetArg(args[num_args], XtNwidth, 100);    ++num_args;
    XtSetArg(args[num_args], XtNheight, 100);   ++num_args;

    appcon = XtCreateApplicationContext();
    display1 = XtOpenDisplay(appcon, NULL, "test1", "Test", NULL, 0, &argc,
argv);
    display2 = XtOpenDisplay(appcon, NULL, "test2", "Test", NULL, 0, &argc,
argv);
    shell1 = XtAppCreateShell("test1", "Test", applicationShellWidgetClass,
                              display1, args, num_args);
    shell2 = XtAppCreateShell("test2", "Test", applicationShellWidgetClass,
                              display2, args, num_args);
    XtRealizeWidget(shell1);
    XtRealizeWidget(shell2);

    XtAppMainLoop(appcon);

    return (0);
}
--

  I noticed that if you pass NULL as the argc argument to XOpenDisplay, it
will try to deference it, so I believe the problem you are seeing may be
passing NULL were a valid pointer is expected. I didn't test connecting
to two different X servers, so there maybe some problem in this case.

> Thanks in advance.
> Bala.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1
> _______________________________________________
> Xpert mailing list
> [EMAIL PROTECTED]
> http://XFree86.Org/mailman/listinfo/xpert

Paulo
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to