Re: [MacRuby-devel] MacRuby-devel Digest, Vol 56, Issue 5
On 17 oct. 2012, at 23:03, mailto:[email protected]>> wrote: I'm afraid setting the variable again in Xcode is not an option. I was hoping to pick up $CATALINA_HOME to find out where a user had installed tomcat. So where and when is that environment variable set? If you can instruct your user to set it in the global environment, then you should be able to pick it up from any process. The global environment is defined in the file /etc/launchd.conf, and it makes sense for a variable such as CATALINA_HOME to be defined there. Otherwise, best would be to let the tomcat team change their install procedure to either change /etc/launchd.conf, or to call `launchctl setenv CATALINA_HOME /path/to/tomcat` sometime when tomcat launches. Last, you can still parse the configuration file that sets CATALINA_HOME, whether it's ~/.profile, ~/.bash_rc or whatever. Note: user environment used to be defined in ~/.MacOSX/environment.plist, but it seems it's not supported any more in Mac OS X 10.8. Regards, Jean-Denis ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] Quartz 2D Graphics problem
A fairly recent project of mine makes the exact same context call in drawRect.
I just ran it again without a problem. My MacRuby is one of the nightlies from
2-3 weeks ago.
Jim
On Oct 18, 2012, at 12:30 AM, Robert Carl Rice 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
`'
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
[MacRuby-devel] Monitoring file system changes
I've cobbled together a class that wraps FSEventStreamCreate so that I can
monitor a settings.json file and update my application upon its change - à la
Sublime Text 2. I refactored the code I found on the subject in Matt
Aimonetti's book.
So far, it seems to be doing what I expect, but it would ease my mind a bit if
someone who know something of the subject could tell me if I'm setting myself
up for problems, as I don't really understand what's happening in the
background.
Here's an example of it in use:
framework 'cocoa'
class FolderWatch
def initialize(paths, callback, object)
@callback = callback
@paths = [paths].flatten
callback = Proc.new do |stream, client_callback_info, number_of_events,
paths_pointer, event_flags, event_ids|
paths_pointer.cast!("*") # cast as a string pointer
stuff = {
stream:stream,
client_callback_info:client_callback_info,
number_of_events:number_of_events,
paths_pointer:paths_pointer,
event_flags:event_flags,
event_ids:event_ids
}
object.send(@callback, stuff)
end
@stream = FSEventStreamCreate(KCFAllocatorDefault, callback, nil, @paths,
KFSEventStreamEventIdSinceNow, 0.0, 0)
FSEventStreamScheduleWithRunLoop(@stream, CFRunLoopGetCurrent(),
KCFRunLoopDefaultMode)
end
def start
FSEventStreamStart(@stream)
end
def stop
FSEventStreamStop(@stream)
end
end
class Klass
def callback(hash)
puts hash[:paths_pointer][0]
end
end
callback_object = Klass.new
f = FolderWatch.new("/Users/fatboy/Desktop", :callback, callback_object)
f.start
--
Stephen Horne
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] Quartz 2D Graphics problem
Hi Jim,
What frameworks do you included in your project?
Thanks,
Bob Rice
On Oct 18, 2012, at 8:22 AM, Jim Getzen wrote:
> A fairly recent project of mine makes the exact same context call in
> drawRect. I just ran it again without a problem. My MacRuby is one of the
> nightlies from 2-3 weeks ago.
>
> Jim
>
>
> On Oct 18, 2012, at 12:30 AM, Robert Carl Rice 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
> `'
>
> 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
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] Quartz 2D Graphics problem
Aside from MacRuby and a couple of sound frameworks, it just uses Cocoa,
CoreGraphics, and QuartzCore.
Jim
On Oct 18, 2012, at 7:45 PM, Robert Carl Rice wrote:
Hi Jim,
What frameworks do you included in your project?
Thanks,
Bob Rice
On Oct 18, 2012, at 8:22 AM, Jim Getzen wrote:
> A fairly recent project of mine makes the exact same context call in
> drawRect. I just ran it again without a problem. My MacRuby is one of the
> nightlies from 2-3 weeks ago.
>
> Jim
>
>
> On Oct 18, 2012, at 12:30 AM, Robert Carl Rice 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
> `'
>
> 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
___
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
Re: [MacRuby-devel] Quartz 2D Graphics problem
Hi Jim,
Adding those frameworks didn't fix my BridgeSupport problem. Have you tried to
build your project with the most recent nightly build?
Thanks,
Bob Rice
On Oct 18, 2012, at 8:30 PM, Jim Getzen wrote:
> Aside from MacRuby and a couple of sound frameworks, it just uses Cocoa,
> CoreGraphics, and QuartzCore.
>
> Jim
>
>
> On Oct 18, 2012, at 7:45 PM, Robert Carl Rice wrote:
>
> Hi Jim,
>
> What frameworks do you included in your project?
>
> Thanks,
> Bob Rice
>
> On Oct 18, 2012, at 8:22 AM, Jim Getzen wrote:
>
>> A fairly recent project of mine makes the exact same context call in
>> drawRect. I just ran it again without a problem. My MacRuby is one of the
>> nightlies from 2-3 weeks ago.
>>
>> Jim
>>
>>
>> On Oct 18, 2012, at 12:30 AM, Robert Carl Rice 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
>> `'
>>
>> 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
>
> ___
> 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
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] Quartz 2D Graphics problem
Hey Jim,
What version of OS X are you running things on?
On 2012-10-18, at 9:50 PM, Robert Carl Rice wrote:
> Hi Jim,
>
> Adding those frameworks didn't fix my BridgeSupport problem. Have you tried
> to build your project with the most recent nightly build?
>
> Thanks,
> Bob Rice
>
>
> On Oct 18, 2012, at 8:30 PM, Jim Getzen wrote:
>
>> Aside from MacRuby and a couple of sound frameworks, it just uses Cocoa,
>> CoreGraphics, and QuartzCore.
>>
>> Jim
>>
>>
>> On Oct 18, 2012, at 7:45 PM, Robert Carl Rice wrote:
>>
>> Hi Jim,
>>
>> What frameworks do you included in your project?
>>
>> Thanks,
>> Bob Rice
>>
>> On Oct 18, 2012, at 8:22 AM, Jim Getzen wrote:
>>
>>> A fairly recent project of mine makes the exact same context call in
>>> drawRect. I just ran it again without a problem. My MacRuby is one of the
>>> nightlies from 2-3 weeks ago.
>>>
>>> Jim
>>>
>>>
>>> On Oct 18, 2012, at 12:30 AM, Robert Carl Rice 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
>>> `'
>>>
>>> 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
>>
>> ___
>> 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
>
> ___
> 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
