Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Lines with NSBezierPath

Lines with NSBezierPath
Thread Tools
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
Feb 13, 2001, 10:46 AM
 
This is probably a question easily answered but it has been frustrating me alot lately so it goes. I can't get a line to appear when drawn using NSBezierPath's moveToPoint lineToPoint methods. Is there some catch to this? I tried setting the width to a whole bunch of crazy values but can't get anything yet. If possible, could someone post a quick implementation of drawRect that will simply draw a line?

Thanks alot,
Jeff.
Spectral Class
"Shedding Light on Innovation"
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
Feb 13, 2001, 02:32 PM
 
You need to use the -stroke method to actually draw the line represented by the path.

If all you need to do is draw a straight line, then there's a convenience class method called +strokeLineFromPoint:toPoint: on NSBezierPath that will create the path and stroke it all at once.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:23 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2