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

Re: NSView Names


  • Subject: Re: NSView Names
  • From: "Simson Garfinkel" <email@hidden>
  • Date: Thu, 28 Feb 2002 22:10:12 -0500

----- Original Message -----
From: "Ondra Cada" <email@hidden>
To: "Simson Garfinkel" <email@hidden>
Cc: <email@hidden>
Sent: Wednesday, February 27, 2002 10:17 PM
Subject: Re: NSView Names


> Simson,
>
> >>>>>> Simson Garfinkel (SG) wrote at Wed, 27 Feb 2002 18:22:59 -0500:
> SG> They are useful for naming objects. I just wrote a little
SwitchingView
> SG> and I wanted the gizmo to automatically pick up the titles for the
> SG> NSPopUp button from the NIB names. Since I can't get at the NIB Names,
> SG> I'm using the Tool. Tip names instead. It's gross, but it works.
>
> That seems to be a "standard" way to do that ;)
>
> My own private defaults framework just scans all view in the panel; if it
> founds an NSTextView with tooltip of "@<aaa>@[<bbb>@]" it ensures that the
> text view actually edits a string default of name <aaa>; if there's the
<bbb>
> part, it becomes the real tooltip.

Oh, that's very cool. I've built my own defaults framework which actually
requires that you create a single line of code for each preferences widget,
sort of like this:

setDefault(myTextWidget,@"TextWidgetDefault");

The setDefault() function creates a helper object which is made the target
of myTextWidget.. You read the value at other places in your program with
the standard NSUserDefaults.

>
> There are similar hacks for checkboxes, popup menus, etc ;))))))

Me too!

>
> Well although it could be somewhat cleaner, it does not look to me as so
big
> a hack. Actually, I don't think I would use the main window names for this
> anyway: for starters, they cannot be added to any view (but to the root
> objects only); besides, I am used to use them to orient myself in the NIB,
> and this usage would clash.
>
> OTOH, it would be *QUITE* *NICE* if one could, in a special inspector, add
a
> generic dictionary of arbitrary key/value pairs to *any* nibbed object.
The
> dictionary could be stored separately not to slow normal loading of NIBs;
it
> would be loaded only on-demand, if the application wanted to read the
> information from it (hmmmm, that might prove impossible... well, it's too
> late for me to design things correctly ;)

I think that it would be nice if the Defaults String was another object
property, like ToolTips. Then we could easily create preference panels
without all of this junk.
_______________________________________________
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: 
 >NSView Names (From: "Simson Garfinkel" <email@hidden>)
 >Re: NSView Names (From: "Simson Garfinkel" <email@hidden>)
 >Re: NSView Names (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Two basic questions
  • Next by Date: Re: Sheet!
  • Previous by thread: Re: NSView Names
  • Next by thread: Re: NSView Names
  • Index(es):
    • Date
    • Thread