Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resizing window on second screen makes window disappear



I've had a user report a problem with my application's window vanishing when it changes size. The resizing in question is done programmatically, and the window was on a second screen at the time. I'm unable to test this issue because I don't have a second screen. However, my guess is that the second screen is being ignored and the window is being put onto the main screen using the second screen's coordinates (i.e. offscreen).

The window is transparent, borderless, buffered and deferred. Its frame is changed using -setFrame:display:animate:. All that changes is the window's height and the y coordinate of its origin:

	[[presetMatrix window] saveFrameUsingName:@"Widget Window"];
	float currentMatrixHeight = [presetMatrix frame].size.height;
	
	// code which adds cells to the matrix
	
	[presetMatrix sizeToCells];
	NSRect matrixFrame = [presetMatrix frame];
	float newMatrixHeight = matrixFrame.size.height;
	NSRect windowFrame = [[presetMatrix window] frame];
	windowFrame.size.height = newMatrixHeight + 61.0;
	windowFrame.origin.y -= newMatrixHeight - currentMatrixHeight;
	[[presetMatrix window] setFrame:windowFrame display:YES animate:NO];

What am I missing here?

Regards,
Jeremy

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

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.