• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
first steps - a subclassed window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

first steps - a subclassed window


  • Subject: first steps - a subclassed window
  • From: "Lars Elden" <email@hidden>
  • Date: Mon, 6 Feb 2006 12:50:23 +0100

In this sample I try to inherit from NSWindow though it does react to
closing the window, as expected. I appreciate your support, Thanks. Lars

#import <Cocoa/Cocoa.h>

@interface Window : NSWindow
{
}
- ( void ) windowWillClose : ( NSNotification * ) notification;
@end

@implementation Window
- ( void ) windowWillClose : ( NSNotification * ) notification
{
   NSRunAlertPanel( @"windowWillClose", @"event", @"OK", NULL, NULL );
   // [ NSApp terminate : self ];
}
@end

int main( int argc, char *argv[] )
{
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
   NSApplication * app = [NSApplication sharedApplication];
   Window * win = [[Window alloc] initWithContentRect:NSMakeRect( 200, 200,
600, 400 )
                                     styleMask:( NSTitledWindowMask |
NSResizableWindowMask |
                                     NSClosableWindowMask |
NSMiniaturizableWindowMask )
                                     backing:NSBackingStoreBuffered defer:1
];

  [win setTitle:@"Tutor02"];
  [app runModalForWindow: win ];
  [app release];
  [pool release];

  return EXIT_SUCCESS;
}



______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • RE: first steps - a subclassed window
      • From: "Lars Elden" <email@hidden>
References: 
 >first steps - a window (From: "Lars Elden" <email@hidden>)

  • Prev by Date: first steps - a window
  • Next by Date: RE: first steps - a subclassed window
  • Previous by thread: first steps - a window
  • Next by thread: RE: first steps - a subclassed window
  • Index(es):
    • Date
    • Thread