From 5e87627251d430a41c2a68d956710cf9acd69568 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 16 May 2021 11:00:33 -0400 Subject: [PATCH] log window - add button to clear the log --- Ample/Base.lproj/LogWindow.xib | 23 ++++++++++++++++++++++- Ample/LogWindowController.m | 8 ++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Ample/Base.lproj/LogWindow.xib b/Ample/Base.lproj/LogWindow.xib index 8e36756..2a8ee2a 100644 --- a/Ample/Base.lproj/LogWindow.xib +++ b/Ample/Base.lproj/LogWindow.xib @@ -21,7 +21,7 @@ - + @@ -52,10 +52,31 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Ample/LogWindowController.m b/Ample/LogWindowController.m index 55ce845..d73d307 100644 --- a/Ample/LogWindowController.m +++ b/Ample/LogWindowController.m @@ -197,4 +197,12 @@ static NSMutableSet *LogWindows; [LogWindows removeObject: self]; } +#pragma mark - IBActions + +- (IBAction)clearLog:(id)sender { + NSAttributedString *empty = [NSAttributedString new]; + [[_textView textStorage] setAttributedString: empty]; +} + + @end