diff options
author | Teddy Wing | 2023-08-16 01:03:10 +0200 |
---|---|---|
committer | Teddy Wing | 2023-08-16 01:03:10 +0200 |
commit | c8d8ec5ce0778504d70108e0f5e6e2c155959948 (patch) | |
tree | 31ec37ce76a77a5ec083c9fa6be11d83e32b0055 | |
parent | 457427da937e7b99db8b569fe9189228416789b1 (diff) | |
download | Base-Windowed-Application-c8d8ec5ce0778504d70108e0f5e6e2c155959948.tar.bz2 |
AppDelegate: Add an NSTextView to test Edit menu
Most options seem to work, except for Undo, Redo, and the Find commands.
-rw-r--r-- | src/AppDelegate.h | 1 | ||||
-rw-r--r-- | src/AppDelegate.m | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/AppDelegate.h b/src/AppDelegate.h index eb98fd9..a9570b8 100644 --- a/src/AppDelegate.h +++ b/src/AppDelegate.h @@ -2,5 +2,6 @@ @interface AppDelegate : NSObject <NSApplicationDelegate> { NSWindow *_window; + NSTextView *_text_view; } @end diff --git a/src/AppDelegate.m b/src/AppDelegate.m index 18bdc74..4c0ace7 100644 --- a/src/AppDelegate.m +++ b/src/AppDelegate.m @@ -6,6 +6,7 @@ - (void)dealloc { [_window release]; + [_text_view release]; [super dealloc]; } @@ -26,6 +27,10 @@ defer:NO]; [_window setTitle:@"Application"]; + + _text_view = [[NSTextView alloc] + initWithFrame:NSMakeRect(0, 0, 400, 400)]; + [[_window contentView] addSubview:_text_view]; } - (void)applicationDidFinishLaunching:(NSNotification *)notification |