It seems as though the BridgeSupport definition of CGContextRef is missing. At
this point, I'm not sure where it should be coming from, documentation
indicates ApplicationServices.framework, but it's not in there.
On Mountain Lion, we have a similar problem with some CoreGraphics definitions
missing from the bridge support file it should be in. In that case, it turned
out that Apple has two CoreGraphics.frameworks and only one shows up in the
dependency chain. I did a quick ack through the /System/Library/Frameworks and
didn't see a definition for CGContextRef, so I'm not sure if I missed it or if
it is somewhere else now.
Bridge support on stuff that is changing seems to be a bit iffy on Mountain
Lion. The bridge support source used to be on macosforge.org, but Apple seems
to have taken it down (the bridge support developer left Apple and moved to
Belgium). The long term strategy will be to bring the bridge support stuff into
MacRuby itself; however, someone who has the source code will have to post it
somewhere for us first.
Sorry that I don't have better news; Objective-C for this segment might be your
only option. :(
--
Mark
On 2012-10-18, at 12:30 AM, Robert Carl Rice <[email protected]> wrote:
> Hi,
>
> I went back to working on an old project that uses core graphics and I'm
> having problems getting it to run again.
>
> The following code gives me an error with the graphics context:
>
> def drawRect( rect )
> return unless @controller
>
> begin
> @context = NSGraphicsContext.currentContext.graphicsPort
>
> # Scale 15 min intervals to chart area
> @xscale = bounds.size.width / 25.0
> height = bounds.size.height
> @yscale = height / 2.0
> CGContextScaleCTM( @context, @xscale, @yscale )
> CGContextTranslateCTM( @context, 0.5, 0.5 ) # Indent
> from bounds
>
> # restore text size
> CGContextSetTextMatrix( @context,
> CGAffineTransformMakeScale( 1 / @xscale, 1 / @yscale ))
> show_index( height )
>
> rescue => e
> ErrorLog.instance.rescue_error( e )
> end
> end
>
> unrecognized runtime type `{CGContext=}'
> /Users/robertrice/Library/Developer/Xcode/DerivedData/MacDriverLog-ebberjlfoqoqdzenjgqkdbkehuoj/Build/Products/Debug/MacDriverLog.app/Contents/Main_Window.bundle/Contents/Resources/RemarksIndexView.rb:55:in
> `drawRect'
> /Users/robertrice/Library/Developer/Xcode/DerivedData/MacDriverLog-ebberjlfoqoqdzenjgqkdbkehuoj/Build/Products/Debug/MacDriverLog.app/Contents/Resources/rb_main.rb:69:in
> `<main>'
>
> line 55 is the first line:
> @context = NSGraphicsContext.currentContext.graphicsPort
>
> Has anything changed with regard to Quartz 2D drawing?
>
> Thanks,
> Bob Rice
>
> _______________________________________________
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo/macruby-devel
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macruby-devel