Re: Programmatically loading an NSImage via other field
Re: Programmatically loading an NSImage via other field
- Subject: Re: Programmatically loading an NSImage via other field
- From: "Sean McBride" <email@hidden>
- Date: Wed, 3 Dec 2008 22:46:09 -0500
email@hidden (email@hidden) on 2008-12-03 10:23 PM said:
>I'm struggling with how to load an image into an NSImage via another
>field's value.
>
>I have a field that contains a path & name of an image file. The user
>can type it in or select it via OpenFile sheet. This works just fine
>and I'm setting the underlying data object so the value persists.
>
>Now, my question: how do I get that value to propagate over to the image?
When do you want it to? on every keypress? or when the user presses
return? If the latter, use the action method. The former could be
problematic from a usability point of view. What if the folder has
files named "Picture1" and "Picture12"? When I have typed "Picture1"
you would start a slow operation before I want. The latter is also
problematic because it requires the user to press return, and it's not
necessarily obvious that that is required.
Might I suggest using an NSPathControl (with NSPathStylePopUp) instead
of a textfield? It would allow the user to drag and drop a file, or
choose one through an open panel. It sends an action to its target when
the user provides a new file. You could update your NSImage from the
action method.
Sean
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden