• 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
String in NSRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

String in NSRect


  • Subject: String in NSRect
  • From: Brian Amerige <email@hidden>
  • Date: Wed, 13 Sep 2006 23:13:16 -0400

Hi all,

I've got an NSRect with an Image, and a grip that I'm using for a subclassed NSSplitView. Here's the code:

- (void)drawDividerInRect:(NSRect)aRect
{
NSImage *grip = [NSImage imageNamed:@"SplitterHandle.png"];
NSImage *bar = [NSImage imageNamed:@"sidebar_header"];
[bar setFlipped:YES];
[grip setFlipped:YES];
NSImage * canvas = [[[NSImage alloc] initWithSize:aRect.size] autorelease];
NSRect canvasRect = NSMakeRect(0, 0, [canvas size].width, [canvas size].height);
NSRect gripRect = NSMakeRect(0,4, [canvas size].width, [canvas size].height);
gripRect.origin.x = (NSMidX(aRect)*1.9 - ([grip size].width/2));
[canvas lockFocus];
[bar setSize:aRect.size];
[bar drawInRect:canvasRect fromRect:canvasRect operation:NSCompositeSourceOver fraction:1.0];
[grip drawInRect:gripRect fromRect:canvasRect operation:NSCompositeSourceOver fraction:1.0];
[canvas unlockFocus];
[self lockFocus];
[canvas drawInRect:aRect fromRect:canvasRect operation:NSCompositeSourceOver fraction:1.0];
[self unlockFocus];
}


How would I get a string in there are well? (For example, a label for this separator).


Thanks in advance!

Brian Amerige
http://extendmac.com
http://cocoaforum.com

_______________________________________________
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: String in NSRect
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: NSGlyph from Unicode
  • Next by Date: ThreadWorker return value
  • Previous by thread: Re: NSTextField not updating NSUserDefaults using bindings
  • Next by thread: Re: String in NSRect
  • Index(es):
    • Date
    • Thread