[comp.windows.x] two Motif questions

Rick.Kazman@SEI.CMU.EDU (02/07/90)

I am running Motif 1.0 on a Sun3, with SunOS 3.5.  I have been having two
strange problems which I'm hoping someone else has run across.

1) I can't get XtDisplay to work.  My program just hangs at (or just after)
this call.  Instead, I've abandoned XtInitialize, and I'm using its 
component parts, XtToolkitInitialize, XtOpenDisplay (from which I get the
display returned) and XtAppCreateShell.  

2) I can't get a list of the children of a composite widget (a
bulletin_board, for instance).  I use the following code (cw is my
composite widget):


num_children = cw->composite.num_children ;
for (i = 0; i< num_children; i++)
{
    fprintf(stderr, "child %d = %d\n", i, cw->composite.children[i]) ;
    /* My own code goes here */
}

This always bombs out, and if I print the address of the list of children,
it is 0, that is, the way that it is initialized.  I'm confused.  Can
someone out there enlighten me?

Thanks.  rick

murphy@ufp.enet.dec.com (Rick Murphy) (02/07/90)

> I am running Motif 1.0 on a Sun3, with SunOS 3.5.  I have been having two
> strange problems which I'm hoping someone else has run across.
> 
> 1) I can't get XtDisplay to work.  My program just hangs at (or just after)
> this call.  Instead, I've abandoned XtInitialize, and I'm using its 
> component parts, XtToolkitInitialize, XtOpenDisplay (from which I get the
> display returned) and XtAppCreateShell.  
> 
> 2) I can't get a list of the children of a composite widget (a
> bulletin_board, for instance).  I use the following code (cw is my
> composite widget):
> 
> ...deleted
> 
Both of these sound like they have a common cause:
Motif ships it's own set of the Xt Intrinsics, with associated header files.
They are *not* compatible with the X11R3 or R4 files! If you mix the Motif
intrinsics and the "standard" header files, you'll run into all sorts of
strangeness as your applications can't find the proper fields. I know that
XtDisplay broke for me before I figured this out.
	-Rick

Rick Murphy, WA1SPT/4                   Digital Equipment, Landover, MD
murphy@ufp.dco.dec.com                 (UFP stands for United Federation
                                         of Planets - not what *you* were
decwrl!ufp.dco!murphy                    thinking!)
Disclaimer: I don't even speak for myself - my wife does!