Re: Making a NSPanel immovable
Re: Making a NSPanel immovable
- Subject: Re: Making a NSPanel immovable
- From: Jacob Lukas <email@hidden>
- Date: Tue, 22 Jan 2008 14:44:17 -0500
On Jan 22, 2008, at 14:22, R.L. Grigg wrote:
I have a kiosk application that has a NSPanel of controls that the
users want to be positioned at a certain spot on the screen and be
immovable. I subclassed NSPanel and overrode all of the -
setFrame ... methods, but no change. -(void)setFrame:
(NSRect)windowFrame display:(BOOL)displayViews gets invoked once
initially, but not when I drag the panel. I know about
programmatically creating a panel without a title bar, but the panel
has lots of intricate controls on it (built in IB), so I really
don't want to create this programmatically. I hope its just a matter
of overriding the right method...
OSX 10.4.11 Xcode 2.4.1
Russ
I don't know how to prevent it from being dragged, but overriding -
(NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen
*)screen and returning the NSRect you want will cause the panel to
snap back to the correct position when it's done being dragged.
Or you could programmatically create a borderless panel, and use -
setContentView: with a view you've configured in Interface Builder.
-Jacob
_______________________________________________
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