From c8d8ec5ce0778504d70108e0f5e6e2c155959948 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 16 Aug 2023 01:03:10 +0200 Subject: AppDelegate: Add an NSTextView to test Edit menu Most options seem to work, except for Undo, Redo, and the Find commands. --- src/AppDelegate.h | 1 + src/AppDelegate.m | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'src') 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 { 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 -- cgit v1.2.3