Text field focus problem.
Text field focus problem.
- Subject: Text field focus problem.
- From: Chip Howland <email@hidden>
- Date: Fri, 25 Oct 2013 17:17:49 -0500
I am trying to enable a button when the user clicks in a text
field. It is unclear to me what the best way to accomplish this
is. However, after a lot of reading, I decided to make a
subclass of NSTextView to use becomeFirstResponder as described here:
http://macscripter.net/viewtopic.php?id=37078
This was the result:
script ImageField
property parent : class "NSTextField"
property imageSearchButton : missing value
on becomeFirstResponder()
-- enable the appropriate button
imageSearchButton's setEnabled_(true)
return 1
end becomeFirstResponder
end script
The text field runs the becomeFirstResponder handler when
clicked, but enabling the button fails, because
imageSearchButton is null. This is despite the fact that it is
bound correctly in Interface Builder.
This code inside of the same subclass correctly logs imageSearchButton:
on testButtonClicked_(sender)
log imageSearchButton
end testButtonClicked_
If anyone has any idea what I am missing here, or has a better
method to achieve the same end result, I would appreciate it.
This project is using Xcode 3.2.6 in Lion.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden