• 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: binding window titles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding window titles


  • Subject: Re: binding window titles
  • From: Jeff Gilbert <email@hidden>
  • Date: Sun, 5 Jun 2005 13:16:40 -0500


On Jun 4, 2005, at 8:53 PM, Jeff Gilbert wrote:

Hopefully this won't fall on deaf ears, with WWDC right around the corner :-)

I am upgrading an app to use bindings (I can see I will eliminate a ton of code, yeah!). I try to bind the window title using a Title with Pattern to include an attribute from an object in the window. If I update said attribute, the window title updates nicely. However, when the window first appears, it has the default window title (i.e. the document title). I even tried putting [self synchronizeWindowTitleWithDocumentName] in windowDidLoad but it has no effect. The only way I can make it work is to also override windowTitleForDocumentDisplayName:. Is there something I am missing?

After some more digging, I discovered the following...

I set a breakpoint on [NSWindow setTitle] and discovered that the window title was properly set to the bound value as soon as the window was unarchived. However, when I later called [NSWindowController showWindow], the call stack looks like the following:

-[NSWindowController windowTitleForDocumentDisplayName:]
-[NSWindowController synchronizeWindowTitleWithDocumentName]
-[NSWindowController window]
-[NSWindowController showWindow:]

So, it seems that showing the window is hardcoded to call windowTitleForDocumentDisplayName and does not respect the fact that the window title may already be set via a binding. So, I'll probably file a bug/support request to see if this is the intended behavior.

Anyways, this is now moot as I realized that the binding for displayPatternTitle1 is only available in 10.4, and for now I still need to support 10.3.

Jeff
 _______________________________________________
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

  • Follow-Ups:
    • Re: binding window titles
      • From: Lee Morgan <email@hidden>
References: 
 >binding window titles (From: Jeff Gilbert <email@hidden>)

  • Prev by Date: Re: writeToFile:ofType:originalFile:saveOperation: on Tiger
  • Next by Date: Re: Fullscreen code not working
  • Previous by thread: Re: binding window titles
  • Next by thread: Re: binding window titles
  • Index(es):
    • Date
    • Thread