I've encountered a weirdness in layout of a form under some
specific circumstances. The problem seems to be in geometry_manager()
in Form.c. If there is a request to change both the height and width but
only
one can be changed then this function is returning XtGeometryNo, but it
seems that _XmMakeGeometryRequest() expects it to modify the reply
to say what it _would_ accept and return XtGeometryAlmost.
Changing the final return to ..
return (good == 0) ? XtGeometryNo : XtGeometryAlmost;
Is part of the solution. However, the values filled into the reply seem to
be
returning the opposite of what _XmMakeGeometryRequest is expecting.
There's some code that looks like this...
if (Wants(CWWidth))
{
ask++;
if ((mr.request_mode & CWWidth) && mr.width == request->width)
{
good++;
reply->request_mode &= ~CWWidth;
}
}
If we return XtGeometryAlmost, then _XmMakeGeometryRequest will call us a
second time, but if we've masked out the changes that we'll accept then the
2nd
call will only request the changes that we won't accept. If we change it to
this...
if (Wants(CWWidth))
{
ask++;
if ((mr.request_mode & CWWidth) && mr.width == request->width)
{
good++;
}
else
{
// mask out the request if we _couldn't_ honor it
reply->request_mode &= ~CWWidth;
}
}
(and do similar things for the other "Wants" sections). Then if we end up
returning
XtGeometryAlmost, _XmMakeGeometryRequest will call us again with a request
that only asks for what we would have accepted and everything is happy
again.
-- Dave Williss
------
Meddle not in the affairs of dragons,
for you are crunchy and taste good with catsup
_______________________________________________
Lesstif mailing list
[EMAIL PROTECTED]
https://terror.hungry.com/mailman/listinfo/lesstif