summaryrefslogtreecommitdiff
path: root/MLKListenerController.m
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-08-28 12:34:00 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-08-28 12:34:00 +0200
commit372109e385d6de7cf29b378eb6f21edaf15be07c (patch)
tree227fde84238fcd11fd59597ad3842b145a343fdc /MLKListenerController.m
parentbb6d54154bd6a33806c04b98475228450b5aa1b0 (diff)
Listener: Disable the “Submit” button while the interpreter is working, move status messages to the bottom left.
Diffstat (limited to 'MLKListenerController.m')
-rw-r--r--MLKListenerController.m19
1 files changed, 16 insertions, 3 deletions
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