Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSWindow set frame higher than screen

I need help. I have an app like Adium with vertical sliders. But my app change the window height, depending on content. In case if the Screen height less than my app'a window height my window reduces the height automatically.

When I'm trying to use setFrame to my window and set window.frame.size.height higher than screen height then nothing happens.

So the question is: how to set window frame higher than screen height?

like image 972
BUDDAx2 Avatar asked Jun 10 '11 07:06

BUDDAx2


1 Answers

By default, the frameworks make sure you cannot resize your window to be outside the screen frame. To change this behavior, subclass your NSWindow, and override the constrainFrameRect:toScreen: method to return the unaltered frame; something like this:

- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
{
  //return the unaltered frame, or do some other interesting things
  return frameRect;
}
like image 84
Enchilada Avatar answered Oct 15 '22 19:10

Enchilada