diff options
author | Teddy Wing | 2023-08-22 00:50:52 +0200 |
---|---|---|
committer | Teddy Wing | 2023-08-22 00:52:17 +0200 |
commit | 6eafac8dcdd52eb8b1b386747116d9f5a9b63569 (patch) | |
tree | d80b0de9600754194272d8d2cc9e1dd4af2271d8 | |
parent | 43b27f370c4299c9b89cb45d9690bab31c421a10 (diff) | |
download | Base-Windowed-Application-6eafac8dcdd52eb8b1b386747116d9f5a9b63569.tar.bz2 |
AppDelegate: Set `allowsUndo` on the NSTextView
Just discovered this property which enables basic undo/redo
functionality on the NSTextView.
I can now confirm that the Undo and Redo menu bar items do in fact work.
-rw-r--r-- | src/AppDelegate.m | 1 | ||||
-rw-r--r-- | src/MainMenu.m | 1 |
2 files changed, 1 insertions, 1 deletions
diff --git a/src/AppDelegate.m b/src/AppDelegate.m index 0ee85e9..d6cef3e 100644 --- a/src/AppDelegate.m +++ b/src/AppDelegate.m @@ -33,6 +33,7 @@ _text_view = [[NSTextView alloc] initWithFrame:NSMakeRect(0, 0, 400, 400)]; + [_text_view setAllowsUndo:YES]; [[_window contentView] addSubview:_text_view]; // [_window setContentView:_text_view]; } diff --git a/src/MainMenu.m b/src/MainMenu.m index 91dd051..c8b703d 100644 --- a/src/MainMenu.m +++ b/src/MainMenu.m @@ -211,7 +211,6 @@ NSMenuItem *MainMenuCreateEditMenuItem() keyEquivalent:@""]; NSMenu *edit_menu = [[NSMenu alloc] initWithTitle:@"Edit"]; - // TODO: Undo and redo don't work. [edit_menu addItemWithTitle:@"Undo" action:@selector(undo:) |