• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSView not resizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView not resizing


  • Subject: Re: NSView not resizing
  • From: j o a r <email@hidden>
  • Date: Sat, 14 May 2005 16:43:01 +0200


Please don't cross-post!

On 14 maj 2005, at 00.26, Boisy G. Pitre wrote:

(This method is called by the addSubview method, as stated in the NSView class documentation.)

Are you sure that the method is called? Check!

I would have thought that setBounds and setFrame are sufficient to get a view to resize, so Is there something else I should be doing? Is "didAddSubview" the wrong place to perform this type of operation?

I would skip the "setBounds:" call, it's probably not something you need to do.
Add a couple of log statements to see what size is being set. Something like this:


- (void) didAddSubview:(NSView *) view
{
    unsigned int driveCount = [[self subviews] count];

    NSRect viewFrame = [view frame];
    viewFrame.origin.y = (viewFrame.size.height  * (driveCount - 1));
    [view setFrameOrigin: viewFrame.origin];

    NSRect myFrame = [self frame];
    myFrame.size.width = viewFrame.size.width;
    myFrame.size.height = (viewFrame.size.height * driveCount);
    [self setFrame: myFrame];

NSLog(@"view: %@, frame: %@, my frame: %@", view, NSStringFromRect([view frame]), NSStringFromRect([self frame]));
}


j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSView not resizing (From: "Boisy G. Pitre" <email@hidden>)

  • Prev by Date: Re: NSView not resizing
  • Next by Date: Re: long Tigers
  • Previous by thread: Re: NSView not resizing
  • Next by thread: Re: NSView not resizing
  • Index(es):
    • Date
    • Thread