Re: [MacRuby-devel] NSPoint and CGPoint issue

2012-12-13 Thread david kramf
Hi Braxton Cocoa seems to be a bit schizophrenic when handling NSPoint and CGPoint. I tried your advice and that what I got. Certainly one should be careful dealing with these classes !! Thanks, David puts "width is #{width} heght is #{height}" origin = NSPointFromCGPoint(NSMakePoint(width,heig

Re: [MacRuby-devel] NSPoint and CGPoint issue

2012-12-13 Thread david kramf
Hi Min, You are correct. The code doesn't crash now. I guess the reason is that Cocoa succeeded in internally casting this CGPoint to NSPoint. Thanks , David On Dec 10, 2012, at 11:11 AM, Min Soo Kim wrote: > Hi David, > > I ran the following > > framework 'cocoa' > def initLabel(h) >

Re: [MacRuby-devel] NSPoint and CGPoint issue

2012-12-10 Thread david kramf
Braxton, Many Thanks for your advice . I will try to cast from CGPoint to NSPoint . Nim, I will try your code . In addition to the fact that we probably run on a different OS or MacRuby version , the other difference is that you set the width and height to full constants . The division operations

Re: [MacRuby-devel] NSPoint and CGPoint issue

2012-12-10 Thread Braxton Sherouse
I can't speak to the encoding issues, but I can attest to crashing issues with incorrectly assuming the compatibility of NSPoint and CGPoint. It depends what version of Mac OS you're on whether NSPoint can safely be cast as a CGPoint. In older versions of Mac OS, NSPoint used float for its members

Re: [MacRuby-devel] NSPoint and CGPoint issue

2012-12-10 Thread Min Soo Kim
Hi David, I ran the following framework 'cocoa' def initLabel(h) @label = NSTextField.alloc.initWithFrame(CGRectMake(0,0,250, 45)) @label.setStringValue(h) @label.drawsBackground = false @label.bezeled = false @label.font = NSFont.fontWithName("Arial", size:45.

Re: [MacRuby-devel] NSPoint and CGPoint issue

2012-12-09 Thread david kramf
Hi Min, This error message was produced by run environment and not by my code. I don't do (knowingly ) anything with encoded text. Usually I get comprehendible error messages when my code crashes. Thanks, David On Dec 10, 2012, at 2:10 AM, Min Soo Kim wrote: > Hello David, > > In your error me

Re: [MacRuby-devel] NSPoint and CGPoint issue

2012-12-09 Thread Min Soo Kim
Hello David, In your error message it says > undefined method `￯﾿ᄐ￯﾿ᄐ' Why are you getting `￯﾿ᄐ￯﾿ᄐ' instead of 'setFrameOrigin'? Do you have some foreign encoded text somewhere? Min Soo Kim On Dec 10, 2012, at 1:41 AM, david kramf wrote: > Hello, > I am trying to creat

[MacRuby-devel] NSPoint and CGPoint issue

2012-12-09 Thread david kramf
Hello, I am trying to create an NSPoint object so I can call setFrameOrigin but I get in response a CGPoint object . When I pass the CGPoint to setFrameOrigin , it crashes. How do I make NSMakePoint making an NSPoint object and not a CGPoint object. Thank you for your help, David Kramf def