From 77ab7117057ea546427a094d6d6dfc3543139f01 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 20 Aug 2014 15:26:48 -0400 Subject: Implemented TextField.OnChanged() on Mac OS X. --- redo/basicctrls_darwin.m | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'redo/basicctrls_darwin.m') 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 { @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) { -- cgit v1.2.3