Re: [MacRuby-devel] Quartz 2D Graphics problem

2012-10-21 Thread Robert Carl Rice
Hi Mark, Unfortunately, I am not very familiar with objective C syntax. Is it easy to mix objective C statements with MacRuby? For example, How would code the @context = NSGraphicsContext.currentContext.graphicsPort in objective C? Thanks, Bob Rice On Oct 18, 2012, at 1:49 AM, Mark Rada wrote

Re: [MacRuby-devel] Quartz 2D Graphics problem

2012-10-21 Thread Colin Thomas-Arnold
You can certainly compile a group of stuff as a framework, and add that framework to your project, but I've never tried to just toss in .h/.m files and access them from macruby. Can anyone touch on that? I'm interested to hear what can be done there... AFA translating your code into Obj-C...

Re: [MacRuby-devel] Quartz 2D Graphics problem

2012-10-21 Thread Mark Rada
Adding some Objective-C code could be done with a framework as suggested, or by creating a bundle. The bundle process is essentially the same as creating a C extension for Ruby. Any MacRuby project with a C extension could be used as an example: https://github.com/pieter/macruby-bundle-example

Re: [MacRuby-devel] Quartz 2D Graphics problem

2012-10-21 Thread Jim Getzen
You don't need to make a framework or bundle to add Obj-C code to your project. I've been able to just add a .h/.m files directly to the project and call the Obj-C classes contained therein from my MacRuby code, just as if those classes were part of a framework. What you can't do, of course, is

Re: [MacRuby-devel] Quartz 2D Graphics problem

2012-10-21 Thread Robert Carl Rice
Hi, Actually, I already have PBSerialPort m & h files by Paolo Bosetti dropped into my project and it works fine. I was wondering is a class could have both Objective C and Ruby code but from this discussion I gather the class must be either MacRuby or ObjC. Is this correct? Thanks, Bob Rice

Re: [MacRuby-devel] Quartz 2D Graphics problem

2012-10-21 Thread Colin Thomas-Arnold
yup, you can't mix and match within one file. @colinta colinta.com github.com/colinta On Oct 21, 2012, at 1:22 PM, Robert Carl Rice wrote: > Hi, > > Actually, I already have PBSerialPort m & h files by Paolo Bosetti dropped > into my project and it works fine. I was wondering is a class co

[MacRuby-devel] GC warnings playing sound files

2012-10-21 Thread Robert Carl Rice
Hi, I recently added some NSSound alerts to one of my project. It works but it generates a "GC operation on unregistered thread" warning when I play the sound. Is there a way to avoid this warning? Thanks, Bob Rice ___ MacRuby-devel mailing list

Re: [MacRuby-devel] GC warnings playing sound files

2012-10-21 Thread Mark Rada
Hi Rob, That smells suspiciously like a GC bug on Apple's end of things; though it might be a bug in MacRuby. You could find out by writing the same code in Objective-C, then compile with GC and test it out. On 2012-10-21, at 3:37 PM, Robert Carl Rice wrote: > Hi, > > I recentlyadded so