discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBox bug?


From: Nicola Pero
Subject: Re: NSBox bug?
Date: Mon, 17 Mar 2003 18:22:09 +0000 (GMT)

> > > Hi folks,
> > > 
> > > there seems to be a bug in NSBox's "sizeToFit": as far as I can see,
> > > there are three cases:
> [...]
> > 
> > 
> >        else // _content_view has no subviews
> >          {
> >            [_content_view setFrame: [self calcSizesAllowingNegative:
> > NO]];
> >          }
> > 
> > 
> > Do you have an example where this is does not work right?

This case looks so much like a corner case ... where we probably want to
be compatible with Apple, but it's not quite clear what is 'correct'.

The 'sizeToFit' semantics is so vaguely definited in the framework.

Incidentally, I am not convinced that passing -sizeToFit down to the
contentView is a good idea at all - and the framework in general is
inconsistent in its usage of -sizeToFit (which is why inside Renaissance a
different method to do a similar thing is used: -sizeToFitContent).


> Hi there,
> 
> I ran into this while I was working on GPSText (which, incidentally, I
> seem to have released a bit too soon). I think I have an example on my
> account at work (can't access it at the moment). I think the problem
> occured when I put a single-column browser inside a box. NSBrowser doesn't
> recognize sizeToFit, so the NSBox would set its content frame to be empty.

It depends on how you put your NSBrowser inside your NSBox.

There are two ways of doing it:

 [box addSubview: browser];

I think this should work.  The browser will be added as a subview of the
contentView, and the sizeToFit code should size the box to enclose the
contentView's subviews.

You are probably doing 

 [box setContentView: browser];

instead, which does something different.  I think this second is sort of
more advanced.

If you are doing it in this second way, I suggest changing your code to
use the first way of doing it.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]