🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #36763

Re: Trouble with R4/ Athena Viewport

#36763
From: Chris D. Peterson
Date: Tue, 13 Feb 1990 16:36
52 lines
2546 bytes
>  I'm unmanaging my widget, resizing it (XtMakeResizeRequest),
> and then managing it again.

I think the problem is that the Viewport doesn't like to be realized when it
has no managed child.  I consider this a bug in that widget, but until it is
fixed you may have to work around it.

> What is the "correct" way to set the size of a widget from within a widget's
> code?

XtMakeGeometryRequest should be the only interface used by widget writers to ASK
their parent to change their size.   Remember that this is a request.  It is
perfectly acceptable for the parent to say no, or almost.  If you as an
application writer don't like the results then you have to use a different
parent for this widget.  The parent always has the final say about widget
geometry.

> 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.

You can never count on this happening, since the user can always resize your
application to be real small.  You just have to do the best you can.

> When I was using
> XtResizeWidget, the the viewport(parent) wasn't doing the right thing 
> (ie. adding or subtracting the scrollbars, as appropriate).

Don't do that.

> 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.

Why?  Do you get a XtGeometryNo?  If this is the case then you just have to deal
with it, remember that the parent has the final say.  Or perhaps you want the
Viewport to grow to the new size, even though scrollbars are active.  This
behavior is not supported by the Viewport, perhaps you need to create your own
widget that supports the behavior that you desire.

Why not just let the user resize the widow if he/she wants it to be bigger?

I'm confusing myself, I'd better quit while I'm ahead.


						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213
			
Technical Details
Message-ID: <9002131636.AA11414@expo.lcs.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit
References: <1990Feb12.235042.13636@agate.berkeley.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit
From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson)
Newsgroups: comp.windows.x
Subject: Re: Trouble with R4/ Athena Viewport
Message-ID: <9002131636.AA11414@expo.lcs.mit.edu>
Date: 13 Feb 90 16:36:16 GMT
References: <1990Feb12.235042.13636@agate.berkeley.edu>
Sender: daemon@athena.mit.edu (Mr Background)
Organization: The Internet
Lines: 52