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

Re: String in NSRect


  • Subject: Re: String in NSRect
  • From: "I. Savant" <email@hidden>
  • Date: Thu, 14 Sep 2006 08:57:51 -0400


You'll want to search this list's archives for book recommendations, but the most popular suggestion is Cocoa Programming by Aaron Hillegass.


You'll also want to google Andy Lee's AppKiDo, a very useful, free Cocoa "documentation browser" that, IMO, works far better than XCode's.

--
I.S.


On Sep 14, 2006, at 8:48 AM, manoj agrawal wrote:

Hi All,

I am new into this technology (COCOA).
Can you guys please suggest me some basic books/PDF's/Reference Material for this technology....
Ig any online tutorial is available then it will also help me learning this.


Thanks.

"I. Savant" <email@hidden> wrote:
   Read up on NSString's documentation. The -
drawInRect:withAttributes: method and its variants seem perfectly
suited for drawing strings in rects. :-)

--
I.S.


On Sep 13, 2006, at 11:13 PM, Brian Amerige wrote:

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:
40gmail.com

This email sent to email@hidden

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


This email sent to email@hidden



---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1&cent;/min.

_______________________________________________ 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:
    • Upgrade From Mac OS10.3.9 to 10.4 on Power G4
      • From: manoj agrawal <email@hidden>
    • Guide
      • From: manoj agrawal <email@hidden>
References: 
 >Re: String in NSRect (From: manoj agrawal <email@hidden>)

  • Prev by Date: Re: Bindings / Core Data: Ensuring a value is unique
  • Next by Date: Re: Populate NSTextView from NSPopupButton
  • Previous by thread: Re: String in NSRect
  • Next by thread: Guide
  • Index(es):
    • Date
    • Thread