[ba.windows.x] using XtIsManaged or XtIsRealized

chapman@lll-lcc.UUCP (Carol Chapman) (04/14/89)

I am using X11R3 with the Athena widgets.  I have a large viewport
widget within which I would like to display 3 color digitized images.
I have created 3 Core widgets to hold each of these images.  The
images will change depending on what the user wants to look at, so I
need to be able to "wipe out" the image in a Core widget and then redo
it with the new image.  The following is the routine I am attempting
to use for this purpose, but I get a unix segmentation violation when
I get to the line involving XtIsManaged.  I tried replacing
XtIsManaged with XtIsRealized, but I get the same error.  What is
wrong?

carol
---------------------------------------------------------------------------

static void make_dig_image_widget(image_widget, width, height, image_name)
	Widget *image_widget;
	unsigned int width, height;
	char *image_name;
{
  Arg args[10];
  Cardinal num_args = 0;
  Boolean already_exists = False;

  already_exists = XtIsManaged(*image_widget);
  if (already_exists)  /* the widget has been used before */  {
     XtUnmanageChild(*image_widget);
     XtSetValues(args[num_args], XtNheight, height); num_args++;
     XtSetValues(args[num_args], XtNwidth, width); num_args++;
     XtManageChild(*image_widget);
  }  /* of if */
  else  /* this is the first time the widget is to be used */  {
     XtSetArg(args[num_args], XtNheight, height); num_args++;
     XtSetArg(args[num_args], XtNwidth, width); num_args++;
     *image_widget = XtCreateManagedWidget(image_name, widgetClass,
           image_viewport, args, num_args);
  }  /* of else */
}


-- 
-------------------------------------------------------------------------------
Livermore Lab            (chapman@lll-crg.llnl.gov or chapman@lll-lcc.llnl.gov)
P.O. Box 808, L-153      Tel. (415) 423-7876
Livermore, CA  94550     "Never own anything that you have to FEED or PAINT."