• 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
Is NSWindow's setContentResizeIncrements: buggy resizing over the dock?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is NSWindow's setContentResizeIncrements: buggy resizing over the dock?


  • Subject: Is NSWindow's setContentResizeIncrements: buggy resizing over the dock?
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 10 Mar 2005 12:10:14 -0500
  • Organization: Rogue Research

Hi all,

I'm using the code below to force my window to only resize by even
amounts.  Then in the windowDidResize: delegate method I verify it.  I'm
basing this on the frame size of the content view, which I'm pretty sure
is the right thing to be looking at.

99% of the time there is no problem.  However, if the dock is at the
bottom, and I resize the window downwards into the dock, my assert fires.
It repros easily, though not 100%.

Am I doing something wrong? Is this a (known) bug? Thanks!

My sample is here:
<http://www.rogue-research.com/seantemp/TestApp.zip>

Code:
- (void)awakeFromNib
{
 [[self window] setContentResizeIncrements:
    NSMakeSize(2.0f, 2.0f)];

	lastSize = [[[self window] contentView] frame].size;
}

- (void)windowDidResize:(NSNotification*)aNotification
{
	NSSize		currSize = [[[self window] contentView] frame].size;
	float		deltaW = currSize.width - lastSize.width;
	float		deltaH = currSize.height - lastSize.height;

	assert ( (floorf (deltaW) == deltaW) && (floorf (deltaH) == deltaH) );
	int			dW = (int)deltaW;
	int			dH = (int)deltaH;

	assert ((dW % 2) == 0);
	assert ((dH % 2) == 0);  // BAM!

	lastSize = currSize;
}


--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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

  • Prev by Date: Re: Detect URL in NSTextView
  • Next by Date: Re: NSPopUpButton question (newbie)
  • Previous by thread: Re: AuthorizationExecuteWithPrivileges(): implementation bug or correct behavior?
  • Next by thread: NSArray vs. NSSet
  • Index(es):
    • Date
    • Thread