| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| While that works, it's generally a good idea to avoid using the Obj-C methods when there already exists a technique in AppleScript. Whilst I don't know the internal mechanics of AS Studio (eg, exactly how commands are hooked), I would think that using call method anything would make AppleScript have to do double work to execute the command (not necessarily double CPU time, granted). That and the call method syntax just gets messy. Compare: set currentTableview to table view "myTable" of scroll view "myTable" of window "myWindow" call method "deselectAll:" of currentTableview with parameter {true} to set selected rows of table view "myTable" of scroll view "myTable" of window "myWindow" to {} or set selected row of table view "myTable" of scroll view "myTable" of window "myWindow" to 0 To continue with the other original question, why using the arrow keys does not trigger a clicked event, well, that statement in and of itself should answer it: keys don't "click", mouses do. If the goal is trigger an event when the mouse clicks on the table view (thus changing the selection) then it would be best to use the "on selection changed" event (or any one of its variants). This will catch both click and key down events that trigger the selection of the table view to change. However, what it won't catch is if the user clicked on the currently selected row. This can be worked around by using the following example set-up that (should) avoid a double run of your table code (this is totally untested but should give you a general idea of approaching it). property lastSelectedRow : 0 on selection changed theObject if theObject's name is "myTable" then tableViewSubroutine() set lastSelectedRow to theObject's selected row end if end selection changed on clicked theObject if theObject's name is "myTable" then if theObject's current selected row equals lastSelectedRow then tableViewSubroutine() end if end if end clicked on tableViewSubroutine() (* do stuff *) end tableViewSubroutine Matthew Stuckwisch Senior, Spanish and New Media University of Alabama On Apr 24, 2005, at 7:43 AM, Novice Software wrote:
|
_______________________________________________ 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
| References: | |
| >Remove of selection in table view (From: Heinrich Bjerregaard <email@hidden>) | |
| >Re: Remove of selection in table view (From: Novice Software <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.