From 372109e385d6de7cf29b378eb6f21edaf15be07c Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 28 Aug 2008 12:34:00 +0200 Subject: =?UTF-8?q?Listener:=20Disable=20the=20=E2=80=9CSubmit=E2=80=9D=20?= =?UTF-8?q?button=20while=20the=20interpreter=20is=20working,=20move=20sta?= =?UTF-8?q?tus=20messages=20to=20the=20bottom=20left.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MLKListenerController.m | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'MLKListenerController.m') diff --git a/MLKListenerController.m b/MLKListenerController.m index e89adf4..88a58d6 100644 --- a/MLKListenerController.m +++ b/MLKListenerController.m @@ -30,6 +30,8 @@ NSDictionary *attrs; NSString *input = [inputField stringValue]; MLKPackage *package; + + [submitButton setEnabled:NO]; NS_DURING { @@ -40,6 +42,7 @@ // A parsing error. Beep and let the user try again. // XXX Maybe the status line could be made to provide more information on the error. NSBeep(); + [submitButton setEnabled:YES]; [inputField selectText:self]; return; } @@ -71,9 +74,17 @@ [[text mutableString] appendString:@"\n"]; [text endEditing]; - [indicatorText setStringValue:@"Compiling and executing."]; - // ... - [indicatorText setStringValue:@"Ready."]; + [statusText setStringValue:@"Compiling and executing."]; + NS_DURING + { + // ... + } + NS_HANDLER + { + // ... + } + NS_ENDHANDLER + [statusText setStringValue:@"Ready."]; [text beginEditing]; attrs = [NSDictionary dictionaryWithObjectsAndKeys: @@ -86,5 +97,7 @@ [[text mutableString] appendString:@"\n"]; [text endEditing]; + + [submitButton setEnabled:YES]; } @end -- cgit v1.2.3