[MacRuby] #1338: Can't set origin.x of a NSRect directly
MacRuby
ruby-noreply at macosforge.org
Thu Jun 23 08:23:32 PDT 2011
#1338: Can't set origin.x of a NSRect directly
----------------------------------+-----------------------------------------
Reporter: martin@… | Owner: lsansonetti@…
Type: defect | Status: closed
Priority: blocker | Milestone: MacRuby 0.11
Component: MacRuby | Resolution: invalid
Keywords: |
----------------------------------+-----------------------------------------
Changes (by eloy.de.enige@…):
* status: new => closed
* resolution: => invalid
Comment:
The rect is a copy. You need to get the rect, adjust it, and then assign
it to the view again. This should work:
{{{
framework 'Cocoa'
view = NSView.alloc.init
rect = view.frame
rect.origin.x = 5
view.frame = rect
p view.frame.origin.x # => 5.0
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/1338#comment:4>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list