• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOpenPanel and field setting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenPanel and field setting


  • Subject: Re: NSOpenPanel and field setting
  • From: "Alan Smith" <email@hidden>
  • Date: Tue, 18 Apr 2006 18:13:54 -0400

Thanks.
I found that for me this works:

There are six fields and six buttons. All the buttons are attached to the
same action. When a button is clicked the action goes as follows: The
openPanel is set up and run, then I call a method of my controller, you pass
it a number, 0-5, and it returns the corresponding textField. The buttons
and fields have the same IDs so this is an easy way to do it. You pass the
function the ID of the button and it returns the matching field, enabling me
to setStringValue to the path of the folder that was selected through the
open dialog.

Thanks Alan (no, I'm not missing the comma, I'm thanking Alan Hart)

Thanks, Alan (there)

On 4/18/06, Mike Blaguszewski <email@hidden> wrote:
>
> On Apr 18, 2006, at 11:18 AM, Alan Smith wrote:
>
> > The other question. I have 6 textFields and depending on which of the
> > buttons is pressed it will use an openPanel to select a folder and
> > then the
> > corresponding field will be filled with the path of the folder
> > selected in
> > the panel. How do I do this without using lots of "ifs."
>
> One approach would be to make a custom controller with an IBOutlet
> for the text field and an IBAction method that creates and runs the
> NSOpenPanel (and puts the path into the text field). Instantiate six
> such controllers in the nib, and wire them up in Interface Builder.
>
> --
> Mike Blaguszewski / Ambrosia Software, Inc.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
>
> This email sent to email@hidden
>



--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSOpenPanel and field setting (From: "Alan Smith" <email@hidden>)
 >Re: NSOpenPanel and field setting (From: Mike Blaguszewski <email@hidden>)

  • Prev by Date: Re: [Q] COM and dynamic link library?
  • Next by Date: Re: KVC on an array in an NSDictionary
  • Previous by thread: Re: NSOpenPanel and field setting
  • Next by thread: NSActionCell Subclass: What's happening to my text input?
  • Index(es):
    • Date
    • Thread