aboutsummaryrefslogtreecommitdiffstats
path: root/src/AppDelegate.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/AppDelegate.m')
-rw-r--r--src/AppDelegate.m22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/AppDelegate.m b/src/AppDelegate.m
index d6cef3e..3df04e0 100644
--- a/src/AppDelegate.m
+++ b/src/AppDelegate.m
@@ -6,7 +6,9 @@
- (void)dealloc
{
[_window release];
+ [_scroll_view release];
[_text_view release];
+ // [_text_finder release];
[super dealloc];
}
@@ -34,8 +36,20 @@
_text_view = [[NSTextView alloc]
initWithFrame:NSMakeRect(0, 0, 400, 400)];
[_text_view setAllowsUndo:YES];
- [[_window contentView] addSubview:_text_view];
+ [_text_view setUsesFindBar:YES];
+
+ _scroll_view = [[NSScrollView alloc]
+ initWithFrame:NSMakeRect(0, 0, 400, 400)];
+ [_scroll_view setAutohidesScrollers:YES];
+ [_scroll_view setHasVerticalScroller:YES];
+ [_scroll_view setDocumentView:_text_view];
+
+ [[_window contentView] addSubview:_scroll_view];
// [_window setContentView:_text_view];
+
+ // _text_finder = [[NSTextFinder alloc] init];
+ // [_text_finder setClient:(id<NSTextFinderClient>)_text_view];
+ // [_text_finder setFindBarContainer:_scroll_view];
}
- (void)applicationDidFinishLaunching:(NSNotification *)notification
@@ -44,4 +58,10 @@
[_window makeKeyAndOrderFront:nil];
}
+// - (IBAction)performTextFinderAction:(id)sender
+// {
+// NSLog(@"performTextFinderAction: performing %ld", [sender tag]);
+// [_text_finder performAction:[sender tag]];
+// }
+
@end