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;
|
- (BOOL)isFlipped;
|
||||||
@end
|
@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
|
// NOT USED
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidFinishLaunching: (NSNotification *)notification;
|
|
||||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed: (NSNotification *)notification;
|
|
||||||
- (id) initFormWithTitle:(NSString*)title width:(NSInteger)width height:(NSInteger)height windowStyle: (NSWindowStyleMask) style;
|
- (id) initFormWithTitle:(NSString*)title width:(NSInteger)width height:(NSInteger)height windowStyle: (NSWindowStyleMask) style;
|
||||||
- (void)createApplicationMenu;
|
- (void)createApplicationMenu;
|
||||||
@end
|
@end
|
||||||
@ -622,6 +628,7 @@
|
|||||||
id getTab(id parent, const char *name);
|
id getTab(id parent, const char *name);
|
||||||
|
|
||||||
void eventAction(id widget, EVENT_ACTION callback);
|
void eventAction(id widget, EVENT_ACTION callback);
|
||||||
|
void setDelegate(id widget);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,7 @@ void LB_Clear(id widget) {
|
|||||||
|
|
||||||
void Cocoa_Init() {
|
void Cocoa_Init() {
|
||||||
[NSApplication sharedApplication];
|
[NSApplication sharedApplication];
|
||||||
|
[NSApp setDelegate: [[AppDelegate new] autorelease]];
|
||||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,3 +182,7 @@ void setSystemAction(id widget, const char *Title, const char *actionName) {
|
|||||||
[menuItem setAction: @selector(selector)];
|
[menuItem setAction: @selector(selector)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setDelegate(id widget) {
|
||||||
|
[NSApp setDelegate: widget];
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user