Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change focus to table view.



I am writing an application that allows the user to search using a keyword, then populates a table view with the results. I have used a text field for the keyword entry and a button mapped to the return key to initiate the search.

I would like the application to switch focus to the table view once it is populated. However, the text field seems to intercept the return key and steals focus back from the table view even after the script changes the first responder of the window. The focus works as expected if I use a different keyboard shortcut for the search button. It is only the return key that causes the focus to return to the text field.

Does anyone have a suggestion for fixing this problem? I would appreciate any ideas you might have.

I have included a portion of the script below:

on clicked theObject
if name of theObject is "search_button" then
delete image of image view "viewer" of window "import_window"
set shortname to contents of text field "search_field" of window "import_window"
set imagename to shortname
my getImages(imagename)
tell window "import_window"
set first responder to table view "tableView" of scroll view "scrollView"
end tell
else if name of theObject is "cancel_button" then
quit
end if
end clicked
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden


This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.