Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!cti1!kmeek From: kmeek@cti1.UUCP (Kevin Meek) Newsgroups: comp.windows.x Subject: displaying on multiple servers Message-ID: <502@cti1.UUCP> Date: 6 Jun 91 21:24:12 GMT Organization: Comprehensive Technologies Int., Arlington VA Lines: 89 I am learning X programming and am trying to figure out how to have an application open a widget on two different display servers. I only have the basic MIT distribution -- no motif or open look. I am using an example from the Nutshell sources that I have been hacking on. I get a bus error/ core dump when I run this. Any suggestions/ tips / working examples of multi display programs, would be greatly appreiciated. BTW: Is this the proper place to post this type of questions? It seemed like the most apropriate to me. Kevin Meek kmeek@cti.com ---- source that causes core dump. -- I am running on an AT&T 3B2/600G ---- System V 3.2.2 if that helps. /* * xtwodisp.c */ /* * Include files required for all Toolkit programs */ #include /* Intrinsics Definitions */ #include /* Standard Name-String definitions */ #include /* Needed for applicationShellWidgetClass */ /* * Public include file for widgets we actually use in this file. */ #include /* Athena Label Widget */ main(argc, argv) int argc; char **argv; { XtAppContext app_con; Widget topLevel1, topLevel2, hello, goodbye; Display *display1, *display2; XtToolkitInitialize(); app_con = XtCreateApplicationContext(); display1 = XtOpenDisplay(app_con, NULL, NULL, "XHello", NULL, 0, &argc, argv); display2 = XtOpenDisplay(app_con, "kmeek.cti:0", NULL, "XGoodbye", NULL, 0, &argc, argv); topLevel1 = XtAppCreateShell(app_con, "XHello", applicationShellWidgetClass, display1, NULL, 0); topLevel2 = XtAppCreateShell(app_con, "XGoodbye", applicationShellWidgetClass, display2, NULL, 0); hello = XtCreateManagedWidget( "hello", /* arbitrary widget name */ labelWidgetClass, /* widget class from Label.h */ topLevel1, /* parent widget*/ NULL, /* argument list */ 0 /* arg list size */ ); goodbye = XtCreateManagedWidget( "goodbye", /* arbitrary widget name */ labelWidgetClass, /* widget class from Label.h */ topLevel2, /* parent widget*/ NULL, /* argument list */ 0 /* arg list size */ ); /* * Create windows for widgets and map them. */ XtRealizeWidget(topLevel1); XtRealizeWidget(topLevel2); /* * Loop for events. */ XtAppMainLoop(app_con); } -- Kevin Meek kmeek@cti.com