• 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
Sub-classing NSWindow (i.e. creating a custom title bar)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sub-classing NSWindow (i.e. creating a custom title bar)


  • Subject: Sub-classing NSWindow (i.e. creating a custom title bar)
  • From: Diana Kirtley <email@hidden>
  • Date: Tue, 24 May 2011 13:21:24 -0700
  • Importance: Normal

Hi there,

I have been trying unsuccessfully to create a custom title bar for an NSWindow 
(i.e black instead of gray), and the only approach seems to involve sub-classing.
There are no selectors and the closest thing that comes to manipulating
the graphic properties is the following (in NSWindow.m):

  • static NSCell	*tileCell = nil;
    {...}
    - (void) drawRect: (NSRect)rect
    {
      NSSize iconSize = [GSCurrentServer() iconSize];
    
      [tileCell drawWithFrame: NSMakeRect(0, 0, iconSize.width, iconSize.height)
      		   inView: self];
      [imageCell
           drawWithFrame: NSMakeRect(iconSize.width / 8,
                                     (iconSize.height / 16),
                                     iconSize.width - ((iconSize.width / 8) * 2),
                                     iconSize.height - ((iconSize.height / 8) * 2))
    	      inView: self];
      [titleCell drawWithFrame: NSMakeRect(1, iconSize.height - 12,
    				       iconSize.width - 2, 11)
    		    inView: self];
    }
    

    Has anyone done this before? Can anyone make a suggestion?

    Thanks!

    Diana


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Sub-classing NSWindow (i.e. creating a custom title bar)
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: RE: XCode 4 System Requirement
  • Next by Date: Re: XCode 4 System Requirement
  • Previous by thread: Re: XCode 4 System Requirement
  • Next by thread: Re: Sub-classing NSWindow (i.e. creating a custom title bar)
  • Index(es):
    • Date
    • Thread