[comp.sys.hp] Xt multi-displays in X11R4

harkcom@spinach.pa.yokogawa.co.jp (Alton Harkcom) (06/13/91)

   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 <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include <X11/Xaw/Label.h>

#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);
}

harry@hpcvlx.cv.hp.com. (Harry Phinney) (06/14/91)

Alton Harkcom writes:

> Anybody got any ideas as to how to make it work on my HP?

No, because it works on mine :-) There must be a difference in the
libraries we're using.  I'm using versions of the R4 libraries shipped
with the HP-UX 8.0 release, which must be different in some way from the
libraries you've built from the MIT release.  In particular I'd suspect
changes/patches to Xt might have made a difference.

Harry Phinney   harry@hp-pcd.cv.hp.com