• 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: Scrollers on custom view appearing but not disappearing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrollers on custom view appearing but not disappearing


  • Subject: Re: Scrollers on custom view appearing but not disappearing
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 29 Feb 2008 16:46:34 -0800


On Feb 29, 2008, at 16:00, Steve Weller wrote:

- (void) setFrameSize:(NSSize)newSize
{
	NSSize cSize;
	cSize = [self canvasSize];   // Provides a size

	// Use the larger dimensions of the two rects
	if(newSize.width > cSize.width)
		cSize.width = newSize.width;
	if(newSize.height > cSize.height)
		cSize.height = newSize.height;

  	 [super setFrameSize:cSize];
}

And this works as long as the window is only made smaller. If the window is made larger then the scrollers do not disappear.

Is my approach the right one for what I am trying to achieve?

Probably not. There are various ways the view frame can change, and they don't all funnel through the setFrameSize method.


If you register to receive NSViewFrameDidChangeNotification's for your view (remembering to call setPostsFrameChangedNotifications: YES), it might work to do something like this in the notification method:

	[[NSNotificationCenter defaultCenter] removeObserver: self];
	NSRect frame = [self frame];
	// calculate new frame
	[self setFrame: frame];
	[[NSNotificationCenter defaultCenter] addObserver: self ...

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Scrollers on custom view appearing but not disappearing
      • From: Steve Weller <email@hidden>
References: 
 >Scrollers on custom view appearing but not disappearing (From: Steve Weller <email@hidden>)

  • Prev by Date: Re: View mouse Events
  • Next by Date: Re: Scrollers on custom view appearing but not disappearing
  • Previous by thread: Scrollers on custom view appearing but not disappearing
  • Next by thread: Re: Scrollers on custom view appearing but not disappearing
  • Index(es):
    • Date
    • Thread