samborn@ezx.sunrise.com (Kevin Samborn) (09/27/90)
I do not really understand the fashion in which widgets resize themselves. What I am trying to do is change the background pixmap in a core widget, and have the form containing the core, and the shell above that resize to the size of the pixmap. { Pixmap newpixmap, pixmap; int i; int x, y; unsigned int width, height, bw, depth; unsigned int width_return, height_return; Window rr; Arg args[15]; XtGeometryResult result; XGetGeometry(XtDisplay(fullsizeform), newpixmap, &rr, &x, &y, &width, &height, &bw, &depth); pixmap = XCreatePixmap(XtDisplay(fullsizeform), XtWindow(widget), width, height, depth); XCopyArea(XtDisplay(fullsizeform), newpixmap, pixmap, myGC, 0, 0, width, height, 0, 0); newpixmap = full_size; full_size = pixmap; XtSetArg(args[0], XtNbackgroundPixmap, full_size); XtSetValues(graphic, args[0], 1); > i = 0; > XtSetArg(args[i], XtNwidth, width + 40); i++; > XtSetArg(args[i], XtNheight, height + 40); i++; > XtSetValues(fullsizeform, args, i); > or > > XtResizeWidget(fullsizeform, width, height, 0); > or > > result = XtMakeResizeRequest(fullsizeform, width, height, > &width_return, &height_return); > XFreePixmap(XtDisplay(fullsizeform), newpixmap); } This is pretty much the code I have used. As you can see, I am not sure whether to change the size with XtSetValues, XtMakeResizeRequest, or XtResizeWidget. Anyway, none of these changes the size of the widget. The hierarchy looks like this: A dialog shell->a form->a core. I want the whole window to change size to the new background pixmap. kevin samborn samborn@sunrise.com ...!uunet!ezx!samborn
converse@EXPO.LCS.MIT.EDU (09/28/90)
> I do not really understand the fashion in which widgets resize > themselves. The widget that wants to grow or shrink asks it's parent, which asks it's parent, and so on, right up to the shell widget. Then the response propagates back down to the original requesting widget. It has to be a cooperative process. > This is pretty much the code I have used. As you can see, I am not > sure whether to change the size with XtSetValues, XtMakeResizeRequest, > or XtResizeWidget. Anyway, none of these changes the size of the widget. XtMakeResizeRequest and XtResizeWidget should be used only by widget writers, that is, in the implementation of widget geometry management. The application writer should use SetValues. Maybe it is not resizing because the shell resource AllowResize is False.