• 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
How refresh window title
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How refresh window title


  • Subject: How refresh window title
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Tue, 4 Aug 2009 10:51:15 -0400
  • Acceptlanguage: en-US
  • Thread-topic: How refresh window title

I know this is supposed to be trivial but none of the permutations I've
tried have worked [Xcode 3.1.3].  My current incarnation is as follows:

-(void)doShowHide:(BOOL)show time:(short)t
{
   NSWindow *dispWindow = [dispDoc windowForSheet];
   NSString *suffix = [NSString stringWithFormat:@": t = %hd", t];
   NSString *fullTitle = [title stringByAppendingString:suffix];

   if (show == YES) {
      [dispWindow setTitle:fullTitle];
      [dispWindow makeKeyAndOrderFront:self];
      [dispWindow setViewsNeedDisplay:YES];
      [dispWindow display];
   }
   else
      [dispWindow orderOut:self];
}

This function is called periodically via the Event Loop.  There is one
custom view in the window and it *does* redraw as desired.  However, the
title draws only the first time, giving t = 0 in the title and never
changing.

I would like the title to update with time.

Can anyone point out what I am missing?  [Note: The NSString, title, is a
class member.]

Thanks.

--
Mike McLaughlin

_______________________________________________

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

  • Follow-Ups:
    • Re: How refresh window title
      • From: Chris Hanson <email@hidden>
    • Re: How refresh window title
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: [iPhone] networking-is it crippled on the simulator?
  • Next by Date: Re: How refresh window title
  • Previous by thread: Re: [iPhone] networking
  • Next by thread: Re: How refresh window title
  • Index(es):
    • Date
    • Thread