• 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: Preferences Panel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preferences Panel


  • Subject: Re: Preferences Panel
  • From: j o a r <email@hidden>
  • Date: Thu, 15 Jul 2004 23:41:05 +0200

On 2004-07-15, at 22.35, Albion Baucom wrote:

> 1. I can't get the panel to display. I created a preferences panel in
> IB,
> and made its file owner "Preferences". I have a Preferences.m and
> Preferences.h file in my Xcode project. I created an outlet for a
> NSWindowController (preferencesPanelController), and an outlet for a
> NSPanel (preferencesPanel) and connected them via IB in the Preferences
> NIB, and the preferences menu option in my MainMenu NIB.
>
> So, when I try to open the preferences via the menu option, I see that
> my
> method is called; "showPanel called" is printed, but the panel never
> appears. I don't get an error, I have tried inside and out of the if()
> statement checking if the preferencesPanelController has been
> instantiated, and the NSLog shows a healthy NSWindowController object.

It's very common to forget to connect the "window" outlet of the
NSWindowController in the nib file to the NSWindow instance in the nib
file. Double check!

> In IB, you can use a "Window" or a "Panel" as a preferences panel. I
> chose
> the Panel widget. Would that make a difference, which I used?

Not for this particular problem.

> 2. Once I get a preferences panel to display, I have to direct its
> actions
> at the currently active document window, or if the user chooses, all
> currently open windows. How do I go about targeting the active window,
> or
> all of them simultaneously?

One way is to access them like this:

Frontmost window:

[NSApp keyWindow]; (or [NSApp mainWindow], whichever you prefer)

All windows (somewhat blunt):

[NSApp windows]

j o a r

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Preferences Panel (From: Albion Baucom <email@hidden>)

  • Prev by Date: Preferences Panel
  • Next by Date: Re: Paragraph width and styled attributed strings
  • Previous by thread: Preferences Panel
  • Next by thread: Guidance on collecting multiple 'documents' as a 'book'
  • Index(es):
    • Date
    • Thread