Skip navigation.
 
mlRe: Making a NSPanel immovable
FROM : Jacob Lukas
DATE : Tue Jan 22 20:44:17 2008

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

Related mailsAuthorDate
mlMaking a NSPanel immovable R.L. Grigg Jan 22, 20:22
mlRe: Making a NSPanel immovable Jacob Lukas Jan 22, 20:44
mlRe: Making a NSPanel immovable glenn andreas Jan 22, 20:48