Hey all, quick question that has been bugging me about NSPanel. I like the look of The NSPanel HUD but for the project I am doing I need the Panel to not be moved. Does anyone know of any possible solutions to make it were my NSPanel cannot be moved at all but maintain its buttons interactivity? I've been searching for any questions similar to this for awhile now. Any insight on the issue would be helpful! Thanks.
+1
A:
Don't forget to look in superclasses. A panel is a kind of window, and since Mac OS X 10.6, it's possible to set a window's movable
property to NO
.
I'm with Dave DeLong, though: I hope you have a good reason to break this functionality. Users expect to be able to move windows, especially those with title bars and HUD windows by their backgrounds, out of their way. And remember, you're not the only application on the system; the user may have something important to get to in a window in another application.
Peter Hosey
2010-08-11 07:55:36
yah I have a good reason its not a typical program and its for a demo machine to be displayed. The window is to maintain its interactivity while just sitting 1 layer above the desktop. It is a small window and I would like it if the position was fixed to avoid accidental dragging and it should maintain screen center.Thanks for he answer I will dig into it.
Rugluds
2010-08-11 13:40:44
Sounds like it shouldn't have a title bar, either. Cutting that out and not making the panel movable by its background should solve the problem just as well.
Peter Hosey
2010-08-11 13:52:38