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

Problems drawing... Need help please.


  • Subject: Problems drawing... Need help please.
  • From: "Brian O'Brien" <email@hidden>
  • Date: Sun, 23 Oct 2005 14:57:33 -0600

Sorry if this code is in Python.. but its calling NS routines.
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()
self.path.fill()
NSColor.colorWithDeviceRed_green_blue_alpha_(sor, sog, sob, soa).set()
self.path.stroke()
else:
NSColor.colorWithDeviceRed_green_blue_alpha_(nfr, nfg, nfb, nfa).set()
self.path.fill()
NSColor.colorWithDeviceRed_green_blue_alpha_(nor, nog, nob, noa).set()
self.path.stroke()
self.path.closePath()


if ((self.mouseInBounds == True) | (self.selectedControlPoint[0] == True)):
i = 0
for pt in self.controlPoints:
if (self.selectedControlPoint[0] == True) & (i == self.selectedControlPoint[1]):
NSColor.colorWithDeviceRed_green_blue_alpha_ (0,0,1,1)
print 'hit'
else:
NSColor.colorWithDeviceRed_green_blue_alpha_ (0,1,1,1)
print 'miss'
r = NSRect((pt.x-1, pt.y-1), (3, 3))
p = NSBezierPath.bezierPathWithRect_(r)
p.closePath()
p.fill()
p.stroke()
i = i + 1


_______________________________________________
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: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Difference between dvd and dmg
  • Next by Date: Predicates to filter one array controller based on content from the other
  • Previous by thread: How to link a Cocoa shell tool to an embedded framework
  • Next by thread: Re: Problems drawing... Need help please.
  • Index(es):
    • Date
    • Thread