• 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: Problems drawing... Need help please.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems drawing... Need help please.


  • Subject: Re: Problems drawing... Need help please.
  • From: Sherm Pendley <email@hidden>
  • Date: Sun, 23 Oct 2005 18:16:53 -0400

On Oct 23, 2005, at 4:57 PM, Brian O'Brien wrote:

Sorry if this code is in Python.. but its calling NS routines.

As I understand it, the Cocoa framework is the topic here, regardless of the language.


I'm having trouble getting the line caps and joints and colors correct...

I basically want to set a color, draw a path then on to the next object to be drawn...
Seems like every thing is being drawn in one color only...


            self.path.setLineJoinStyle_(NSMiterLineJoinStyle)
            self.path.setLineCapStyle_(NSButtLineCapStyle)

if self.mouseHit == True:
NSColor.colorWithDeviceRed_green_blue_alpha_(sfr, sfg, sfb, sfa).set()

... snip ...

if (self.selectedControlPoint[0] == True) & (i == self.selectedControlPoint[1]):
NSColor.colorWithDeviceRed_green_blue_alpha_ (0,0,1,1)

One of these things is not like the other... You forgot to set() the color here.


print 'hit'
else:
NSColor.colorWithDeviceRed_green_blue_alpha_ (0,1,1,1)

Same here.

                        print 'miss'
                    r = NSRect((pt.x-1, pt.y-1), (3, 3))
                    p = NSBezierPath.bezierPathWithRect_(r)
                    p.closePath()
                    p.fill()
                    p.stroke()

So, all of these paths are drawn in the first color that was set() above.


sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
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: Problems drawing... Need help please.
      • From: "Brian O'Brien" <email@hidden>
References: 
 >Problems drawing... Need help please. (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: Re: FSRefMakePath: error -35
  • Next by Date: Re: FSRefMakePath: error -35
  • Previous by thread: Problems drawing... Need help please.
  • Next by thread: Re: Problems drawing... Need help please.
  • Index(es):
    • Date
    • Thread