I figured out how to get the NSPathControl to "resize" after changing an 
NSPathComponentCell URL.
I realize that the description I gave is vague, so here is a better 
explanation..

I am changing the URL of a NSPathComponent in the middle of NSPathControl's 
overall URL.
By making the change, I was hoping that the imagery would adjust itself after I 
made the change.
This turned out to not be the case.

Here is what I discovered:

NSPathComponentCell contains its "fragment" of the path. If you have a path 
like:
/Users/myhome/Movies/Summer/MyMovie.mov
and you want to change "Summer" to "Winter", you would find the NSComponentCell 
and make the URL change.
(ie: /Users/myhome/Movies/Summer becomes /Users/myhome/Movies/Winter)
The problem is that NSPathControl still sees the original path with "Summer".

I found that I had to iterate through the rest of the NSPathComponentCells in 
NSPathControl, and update each of the subsequent NSComponentCell objects with 
the new URL fragments.
I then took the last URL fragment, and then updated NSPathControl with the 
newly changed URL.

That no only re-drew the artwork, but also correctly updated the URL path in 
NSPathControl.

A lot of work, but thats what it took.

bob..


On Mar 9, 2010, at 12:57 PM, Robert Monaghan wrote:

> Yeah, I did.. that didn't work either.
> Tried:
> [myPathControl sizeToFit];
> 
> bob.
> 
> On Mar 9, 2010, at 12:33 PM, Sean McBride wrote:
> 
>> On Tue, 9 Mar 2010 12:26:14 -0800, Robert Monaghan said:
>> 
>>> I am changing the NSURL of a path, that drives NSPathControl.
>>> If I edit the path so that the new text element of that path is longer
>>> or shorter than the original path,
>>> I would need to have NSPathControl redraw itself..
>> 
>> Did you try "sizeToFit"?
>> 
>> -- 
>> ____________________________________________________________
>> Sean McBride, B. Eng                 s...@rogue-research.com
>> Rogue Research                        www.rogue-research.com 
>> Mac Software Developer              Montréal, Québec, Canada
>> 
>> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/bob%40gluetools.com
> 
> This email sent to b...@gluetools.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to