• 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: I need a milder application badge (solution)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I need a milder application badge (solution)


  • Subject: Re: I need a milder application badge (solution)
  • From: Rob Keniger <email@hidden>
  • Date: Sun, 26 Jul 2009 13:24:57 +1000


On 26/07/2009, at 11:16 AM, Stuart Malin wrote:

Of course, you can have your custom view draw whatever you'd like (in a 128 x 128 frame).

If the appearance of the view needs to change due to underlying changes in teh state of your app, just issue the -display message to the dockTile:
[NSApp dockTile] display];
and the contentView object's -drawRect will be called.


Stuart's technique is the correct one. You can easily draw the application icon with a badge in the -drawRect: method of your custom DockTile view:

- (void)drawRect:(NSRect)rect
{
	NSRect bounds = [self bounds];

//draw the icon
NSImage* icon = [NSImage imageNamed:@"NSApplicationIcon"];
[icon setSize:bounds.size];
[icon drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];

//draw your badge
//badge drawing calls here
}


I do this myself in one of my apps and it works perfectly.

--
Rob Keniger



_______________________________________________

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: I need a milder application badge (solution #2)
      • From: Jay Reynolds Freeman <email@hidden>
References: 
 >Re: I need a milder application badge (solution) (From: Stuart Malin <email@hidden>)

  • Prev by Date: Re: NSScrollView Not Updating
  • Next by Date: How do I extract the int value from an xml node/element?
  • Previous by thread: Re: I need a milder application badge (solution)
  • Next by thread: Re: I need a milder application badge (solution #2)
  • Index(es):
    • Date
    • Thread