mirror of
https://github.com/Airr/nim-cocoa.git
synced 2024-11-24 09:45:30 +00:00
Added AppDelegate object
This commit is contained in:
parent
82ab438219
commit
b74b9ff733
@ -93,13 +93,19 @@
|
||||
- (BOOL)isFlipped;
|
||||
@end
|
||||
|
||||
@interface CocoaWindow : NSWindow <NSApplicationDelegate,NSUserNotificationCenterDelegate,NSWindowDelegate, NSTextFieldDelegate>
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate,NSUserNotificationCenterDelegate,NSWindowDelegate, NSTextFieldDelegate>
|
||||
|
||||
- (void)applicationDidFinishLaunching: (NSNotification *)notification;
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed: (NSNotification *)notification;
|
||||
|
||||
@end
|
||||
|
||||
@interface CocoaWindow : NSWindow
|
||||
{
|
||||
// NOT USED
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching: (NSNotification *)notification;
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed: (NSNotification *)notification;
|
||||
|
||||
- (id) initFormWithTitle:(NSString*)title width:(NSInteger)width height:(NSInteger)height windowStyle: (NSWindowStyleMask) style;
|
||||
- (void)createApplicationMenu;
|
||||
@end
|
||||
@ -622,6 +628,7 @@
|
||||
id getTab(id parent, const char *name);
|
||||
|
||||
void eventAction(id widget, EVENT_ACTION callback);
|
||||
void setDelegate(id widget);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -119,6 +119,7 @@ void LB_Clear(id widget) {
|
||||
|
||||
void Cocoa_Init() {
|
||||
[NSApplication sharedApplication];
|
||||
[NSApp setDelegate: [[AppDelegate new] autorelease]];
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
}
|
||||
|
||||
@ -181,3 +182,7 @@ void setSystemAction(id widget, const char *Title, const char *actionName) {
|
||||
[menuItem setAction: @selector(selector)];
|
||||
}
|
||||
}
|
||||
|
||||
void setDelegate(id widget) {
|
||||
[NSApp setDelegate: widget];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user