Okay, let's say I've got an NSScrollView tied to an arrayController. Heck, let's say I've got a few tied into eachother to create a tree. The plist passes nested arrays to allow a user to, say, pick a Backpack page->note->edit the note and return to TM where the script takes the updated note and returns it to Backpack.
I've got the first half all finished, but the plist that comes back to TM just contains the whole array including the edited note and there's no easy way to tell what's changed. How do I pass back the id's of the selected page/note and the note body separately or marked as modified?
Any help would be greatly appreciated.
Thanks, Brett
On 18. Nov 2006, at 02:01, Brett Terpstra wrote:
Okay, let's say I've got an NSScrollView tied to an arrayController. Heck, let's say I've got a few tied into eachother to create a tree. The plist passes nested arrays to allow a user to, say, pick a Backpack page->note->edit the note and return to TM where the script takes the updated note and returns it to Backpack.
I've got the first half all finished, but the plist that comes back to TM just contains the whole array including the edited note and there's no easy way to tell what's changed. How do I pass back the id's of the selected page/note and the note body separately or marked as modified?
Do I spot two questions here:
Q: How do I know which items in an array was edited? A: No other way than iterate the data and compare with the original
Q: How do I get the selected item back A: Bind your okay button’s target to selection.controller [NSObjectController] Bind the first argument to the selected object from the root array controller Put returnArgument: as the selector for one of the above two bindings.
See http://lists.macromates.com/pipermail/textmate/2006-November/ 015321.html for more verbose explanation.
Ah, it was the returnArgument: I needed, I think. Thanks, Allan!
Brett
On Nov 18, 2006, at 5:07 AM, Allan Odgaard wrote:
Do I spot two questions here:
Q: How do I know which items in an array was edited? A: No other way than iterate the data and compare with the original
Q: How do I get the selected item back A: Bind your okay button’s target to selection.controller [NSObjectController] Bind the first argument to the selected object from the root array controller Put returnArgument: as the selector for one of the above two bindings.
See http://lists.macromates.com/pipermail/textmate/2006-
November/015321.html for more verbose explanation.
It should be noted (for those of us who are a little slower) that you have to remove the performButtonClick connection for the returnArgument to work.
Is there any reason that the returnArgument would cause TM to hang until the mouse moves? I thought it was hanging for 2-3 minutes at a time and then finally made the connection that it was responding as soon as I moved the mouse. The response is very quick if I keep the mouse in motion, otherwise I just get a beach ball after the dialog completes.
Thanks, Brett
On Nov 18, 2006, at 5:14 AM, Brett Terpstra wrote:
Ah, it was the returnArgument: I needed, I think. Thanks, Allan!
Brett
On Nov 18, 2006, at 5:07 AM, Allan Odgaard wrote:
Do I spot two questions here:
Q: How do I know which items in an array was edited? A: No other way than iterate the data and compare with the original
Q: How do I get the selected item back A: Bind your okay button’s target to selection.controller [NSObjectController] Bind the first argument to the selected object from the root array controller Put returnArgument: as the selector for one of the above two bindings.
See http://lists.macromates.com/pipermail/textmate/2006-
November/015321.html for more verbose explanation.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Brett Terpstra : Art Director Circle Six Design, Inc. 111 Riverfront Dr, Suite 204 .................................................. p: 507.459.4398 877.858.4332 f: 1.866.540.3063 e: brett@circlesixdesign.com http://www.circlesixdesign.com ..................................................
On 18. Nov 2006, at 15:52, Brett Terpstra wrote:
Is there any reason that the returnArgument would cause TM to hang until the mouse moves? I thought it was hanging for 2-3 minutes at a time and then finally made the connection that it was responding as soon as I moved the mouse. The response is very quick if I keep the mouse in motion, otherwise I just get a beach ball after the dialog completes.
I had the same problem when the dialog was forcefully closed by killing tm_dialog -- it seems to be a system bug and I made a workaround which is 99% successful.
But I never experienced it with returnArgument: -- if you send me a command + nib, I can look into it.