Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!kddlab!cs.titech!wnoc-tyo-news!dclsic!sjc!leia!harkcom From: harkcom@spinach.pa.yokogawa.co.jp (Alton Harkcom) Newsgroups: comp.sys.hp Subject: Xt multi-displays in X11R4 Message-ID: Date: 13 Jun 91 08:28:41 GMT Sender: news@leia.pa.yokogawa.co.jp Organization: Yokogawa Electric Corporation, Tokyo, Japan Lines: 43 Somebody recently posted some source in comp.windows.x which was for creating widgets on multiple displays from one program. I tried it on a Sun, and a Sony and it worked, but on my HP (HP9000/400t, HP_UX 7.03, server = X11R4, libraries = X11R4) it hangs up on a second call to XtRealize widget. Anybody got any ideas as to how to make it work on my HP? ------redone source--------------------------------------------- #include #include #include #include #define DISPLAYS 2 main(argc, argv) int argc; char **argv; { XtAppContext app_con; Widget app_top, topLevel[2], label[2]; Display *display[2]; int i; String dpy_name[2]; String app_name = "x2dpy"; String app_class = "X2dpy"; dpy_name[0] = "me:0"; dpy_name[0] = "other:0"; app_top = XtAppInitialize(&app_con, app_class, NULL, 0, &argc, argv, NULL, NULL, 0); for (i = 0; i < DISPLAYS; i++) { display[i] = XtOpenDisplay(app_con, dpy_name[i], app_name, app_class, NULL, 0, &argc, argv); topLevel[i] = XtAppCreateShell(app_name, app_class, applicationShellWidgetClass, display[i], NULL, 0); label[i] = XtCreateManagedWidget("this is a label", labelWidgetClass, topLevel[i], NULL, 0); XtRealizeWidget(topLevel[i]); } XtAppMainLoop(app_con); }