[MacRuby] #990: Calling some CGContext functions raises 'instance variable __octype__ not initialized' warning
MacRuby
ruby-noreply at macosforge.org
Sun Nov 7 05:16:07 PST 2010
#990: Calling some CGContext functions raises 'instance variable __octype__ not
initialized' warning
----------------------------------+-----------------------------------------
Reporter: sojastar07@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: minor | Milestone:
Component: MacRuby | Keywords: CGContext warning unknown variable
----------------------------------+-----------------------------------------
Running the following script will raise two 'instance variable __octype__
not initialized' warnings after calls to CGPDFContextCreateWithURL and to
CGContextShowGlyphsAtPoint even though the __octype__ variable is never
explicitly used in the script.
---
framework 'Cocoa'
url = CFURLCreateWithFileSystemPath(nil, './my_pfd.pdf',
KCFURLPOSIXPathStyle, 0)
page_rectangle_pointer =
Pointer.new_with_type('{CGRect={CGPoint=dd}{CGSize=dd}}')
page_rectangle_pointer[0] = NSMakeRect(0,0,100,100)
pdf_context = CGPDFContextCreateWithURL(url, page_rectangle_pointer, nil)
CGPDFContextBeginPage(pdf_context, nil)
CGContextSelectFont(pdf_context, "TimesNewRomanPSMT", 11.0,
KCGEncodingMacRoman)
CGContextSetCMYKFillColor(pdf_context, 0.0, 0.0, 0.0, 1.0, 1.0)
string = Pointer.new_with_type(:S, 4)[[BR]]
string[0] = 68[[BR]]
string[1] = 69[[BR]]
string[2] = 70[[BR]]
string[3] = 71[[BR]]
CGContextShowGlyphsAtPoint(pdf_context, 25.0, 45.0, string, 4)
CGPDFContextEndPage(pdf_context)
CGPDFContextClose(pdf_context)
---
Calling the script produces the following output :
$ macruby -w cocoapdf.rb
unknown: warning: instance variable __octype__ not initialized
unknown: warning: instance variable __octype__ not initialized
This is on 10.6.4 with MacRuby 0.7.1.
--
Ticket URL: <http://www.macruby.org/trac/ticket/990>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list