Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!bionet!agate!color.ced.berkeley.edu!spanki From: spanki@color.ced.berkeley.edu (Frank Goodman) Newsgroups: comp.windows.x Subject: Trouble with R4/ Athena Viewport Keywords: Athena, Message-ID: <1990Feb12.235042.13636@agate.berkeley.edu> Date: 12 Feb 90 23:50:42 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: spanki@color.ced.berkeley.edu (Frank Goodman) Organization: UC Berkeley Center of Environmental Design Research Lines: 32 I have a widget of my own, that is a child of a viewport widget. My widget is essentially a raster editor. When the application starts up, the child widget defaults to 400x400. When I load an image, I resize my editor to the size of the image. I want to set my widget's size to be exactly the size of the image. Since this is happening inside my widgets .c file (ie. not in the application code), I'm unmanaging my widget, resizing it (XtMakeResizeRequest), and then managing it again. This way, I always get XtGeometryYes. However, occassionally my program wil dump core, and a trace shows it is dying in XawScrollbarSetThumb. It just occured to me, that this is probably a function of the asynchronous model of X, and the viewport (parent to my widget) is setting it's thumb while my child is unmanaged (the event hasn't gotten processed yet). Is this a logical explanation for my problem? I don't make any calls to a scrollbar widget anywhere in my code. The scrollbars of the viewport are all handled internally by the viewport. What is the "correct" way to set the size of a widget from within a widget's code? The widget needs to resize every time it loads a new image. However, I want it to size itself to the exact size of the image. When I was using XtResizeWidget, the the viewport(parent) wasn't doing the right thing (ie. adding or subtracting the scrollbars, as appropriate). When I use XtMakeGeometryRequest, then I have to unmanage, then manage my widget to be assured of the right geometry, thereby causing the above mentioned problem. Any pointers? Frank. --------------------------------------------------------------------------- Frank Goodman arpa: spanki@CED.Berkeley.EDU University of California, Berkeley or: spanki%CED@jade.Berkeley.EDU College of Environmental Design uucp: ...hplabs!ucbvax!ced!spanki S.I.S Research Laboratory phone: Novelty item, not necessary ---------------------------------------------------------------------------