hockeyman
hockeyman

Reputation: 1183

Fullscreen notifications in Objective-C

Is it possible to get notification when application entered fullscreen mode? Because I have to redraw images when app enters full screen, and now I can't do it because I don't know when app enters fullscreen.

I found method:

- (void)windowDidEnterFullScreen:(NSNotification *)notification 

but where I have to use it? Because in NSWindow class it is not working.

Upvotes: 0

Views: 1800

Answers (2)

Ramaraj T
Ramaraj T

Reputation: 5230

You can also use this function

- (void)windowDidResize:(NSNotification *)notification{ 
}

This function get called whenever the size of the window changes.

Upvotes: 1

Kreiri
Kreiri

Reputation: 7850

  1. Full-Screen API in NSWindowDelegate Protocol:

    The following notifications are sent before and after the window enters and exits full-screen mode:

    NSWindowWillEnterFullScreenNotification
    
    NSWindowDidEnterFullScreenNotification
    
    NSWindowWillExitFullScreenNotification
    
    NSWindowDidExitFullScreenNotification
    
  2. How to use delegates

Upvotes: 5

Related Questions