From: Eloy D. <elo...@gm...> - 2007-07-10 11:05:11
|
I added this info to the wiki: http://rubycocoa.sourceforge.net/WorkingWithPointers Eloy On 7/10/07, Axel M. Roest <rub...@me...> wrote: > At 11:26 +0200 10-07-2007, Axel M. Roest (i.e. me) wrote: > >Hi, > > > >I want to use the function elementAtIndex_associatedPoints from > >OSX::NSBezierPathElement, to get to the coordinates in a curve. > > The documentation is a little vague on this function, but the > solution is as follows (thanks Laurent and Eloy): As you expect a > point or array back, RubyCocoa thinks ahead of you and does not > expect an empty array-pointer beforehand as you would in Obj-C. > Instead you just get a new point or array back. You can use the > function as follows: > > element, point = curve.elementAtIndex_associatedPoints(i) > > where i is the index of the curve element you're interested in. > > element is one of OSX::NSMoveToBezierPathElement, > OSX::NSLineToBezierPathElement etc. > point is an NSPoint, in the case of the above, or probably a ruby > array of points in the case of an OSX::NSClosePathBezierPathElement, > but I have not tested bezier curves yet. > > > Axel > -- > _________________________ > Axel Roest > axelloroestello@{AIM/MSN} - Skype:axellofono - XOIP: 084-8749988 > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > |