BUDDAx2
BUDDAx2

Reputation: 399

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?

Upvotes: 5

Views: 1271

Answers (1)

Enchilada
Enchilada

Reputation: 3919

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;
}

Upvotes: 10

Related Questions