[comp.windows.x.motif] Weirdness in XmScrolledWindow

samborn@ezx.sunrise.com (Kevin Samborn) (10/03/90)

		  Try as I might, I could not figure this out.  What I am trying
to do is change the workWindow of an XmScrolled window.  First, I
create the new widget (a drawing area widget) as a child of the
scrolled window.  Then I manage the new child, set the work window
resource and destroy the old work window.  The problem is that
scrollbars do not come up for the new window.  I have tried every
iteration, combination, and order of manage, unmanage, destroy,
realize, and setting the XmNworkWindow on the scrolled window, the old
drawing area, and the new drawing area to no avail.  I even tried
XmScrolledWindowSetAreas with the old values of the scroll bars, and
the new work window, but this should not matter because the scrolling
policy should be XmAUTOMATIC.  I set this before I created the
scrolled window, and it cannot be changed as stated in the manual.
This seems like a pretty simple request... just to change the work
window, and destroy the old widget? What am I doing wrong?

		  Oh- incidentally, this all works if I just XtUnmanageChild the
old drawing area, and don't destroy it.  However, obviously this
presents lots of problems as drawing areas can be huge widgets.

		  This is pretty much the code I am using:

   extern Widget scroll, draw;
	Widget temp, htemp, vtemp;
   int i;
   Arg args[2];

	i = 0;
	XtSetArg(args[i], XmNhorizontalScrollBar, &htemp);    i++;
	XtSetArg(args[i], XmNverticalScrollBar, &vtemp);      i++;
	XtGetValues(scroll, args, i);

	temp = draw
   draw = XmCreateDrawingArea(scroll, "draw", NULL, NULL);

	XtManageChild(draw);

	XmScrolledWindowSetAreas(scroll, htemp, vtemp, draw);
	XtDestroyWidget(temp);
-- 
---------------------
kevin samborn
samborn@sunrise.com

samborn@ezx.sunrise.com (Kevin Samborn) (10/03/90)

		  Try as I might, I could not figure this out.  What I am trying
to do is change the workWindow of an XmScrolled window.  First, I
create the new widget (a drawing area widget) as a child of the
scrolled window.  Then I manage the new child, set the work window
resource and destroy the old work window.  The problem is that
scrollbars do not come up for the new window.  I have tried every
iteration, combination, and order of manage, unmanage, destroy,
realize, and setting the XmNworkWindow on the scrolled window, the old
drawing area, and the new drawing area to no avail.  I even tried
XmScrolledWindowSetAreas with the old values of the scroll bars, and
the new work window, but this should not matter because the scrolling
policy should be XmAUTOMATIC.  I set this before I created the
scrolled window, and it cannot be changed as stated in the manual.
This seems like a pretty simple request... just to change the work
window, and destroy the old widget? What am I doing wrong?

		  Oh- incidentally, this all works if I just XtUnmanageChild the
old drawing area, and don't destroy it.  However, obviously this
presents lots of problems as drawing areas can be huge widgets.

		  This is pretty much the code I am using:

   extern Widget scroll, draw;
	Widget temp, htemp, vtemp;
   int i;
   Arg args[2];

	i = 0;
	XtSetArg(args[i], XmNhorizontalScrollBar, &htemp);    i++;
	XtSetArg(args[i], XmNverticalScrollBar, &vtemp);      i++;
	XtGetValues(scroll, args, i);

	temp = draw
   draw = XmCreateDrawingArea(scroll, "draw", NULL, NULL);

	XtManageChild(draw);

	XmScrolledWindowSetAreas(scroll, htemp, vtemp, draw);
	XtDestroyWidget(temp);


I have a motif service contract


--
kevin samborn
samborn@sunrise.com
..!uunet!ezx!samborn

samborn@ezx.sunrise.com (Kevin Samborn) (10/03/90)

		  Try as I might, I could not figure this out.  What I am trying
to do is change the workWindow of an XmScrolled window.  First, I
create the new widget (a drawing area widget) as a child of the
scrolled window.  Then I manage the new child, set the work window
resource and destroy the old work window.  The problem is that
scrollbars do not come up for the new window.  I have tried every
iteration, combination, and order of manage, unmanage, destroy,
realize, and setting the XmNworkWindow on the scrolled window, the old
drawing area, and the new drawing area to no avail.  I even tried
XmScrolledWindowSetAreas with the old values of the scroll bars, and
the new work window, but this should not matter because the scrolling
policy should be XmAUTOMATIC.  I set this before I created the
scrolled window, and it cannot be changed as stated in the manual.
This seems like a pretty simple request... just to change the work
window, and destroy the old widget? What am I doing wrong?

		  Oh- incidentally, this all works if I just XtUnmanageChild the
old drawing area, and don't destroy it.  However, obviously this
presents lots of problems as drawing areas can be huge widgets.

		  This is pretty much the code I am using:

   extern Widget scroll, draw;
	Widget temp, htemp, vtemp;
   int i;
   Arg args[2];

	i = 0;
	XtSetArg(args[i], XmNhorizontalScrollBar, &htemp);    i++;
	XtSetArg(args[i], XmNverticalScrollBar, &vtemp);      i++;
	XtGetValues(scroll, args, i);

	temp = draw
   draw = XmCreateDrawingArea(scroll, "draw", NULL, NULL);

	XtManageChild(draw);

	XmScrolledWindowSetAreas(scroll, htemp, vtemp, draw);
	XtDestroyWidget(temp);


I have a motif service contract


--
kevin samborn
samborn@sunrise.com
...!uunet!ezx!samborn