summaryrefslogtreecommitdiff
path: root/redo/basicctrls_darwin.m
diff options
context:
space:
mode:
Diffstat (limited to 'redo/basicctrls_darwin.m')
-rw-r--r--redo/basicctrls_darwin.m16
1 files changed, 15 insertions, 1 deletions
diff --git a/redo/basicctrls_darwin.m b/redo/basicctrls_darwin.m
index 5e0ece5..8e16eb1 100644
--- a/redo/basicctrls_darwin.m
+++ b/redo/basicctrls_darwin.m
@@ -9,7 +9,7 @@
#define toNSView(x) ((NSView *) (x))
#define toNSBox(x) ((NSBox *) (x))
-@interface goControlDelegate : NSObject {
+@interface goControlDelegate : NSObject <NSTextFieldDelegate> {
@public
void *gocontrol;
}
@@ -27,6 +27,11 @@
checkboxToggled(self->gocontrol);
}
+- (void)controlTextDidChange:(NSNotification *)note
+{
+ textfieldChanged(self->gocontrol);
+}
+
@end
id newButton(void)
@@ -136,6 +141,15 @@ id newPasswordField(void)
return finishNewTextField(toNSTextField(t), YES);
}
+void textfieldSetDelegate(id textfield, void *t)
+{
+ goControlDelegate *d;
+
+ d = [goControlDelegate new];
+ d->gocontrol = t;
+ [toNSTextField(textfield) setDelegate:d];
+}
+
// also good for labels
const char *textFieldText(id t)
{