[MacRuby] #1338: Can't set origin.x of a NSRect directly
#1338: Can't set origin.x of a NSRect directly ----------------------------------+----------------------------------------- Reporter: martin@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- [code] framework 'Cocoa' view = NSView.alloc.init view.frame.origin.x = 5 p view.frame.origin.x => 0.0 view.frame = [5,0,0,0] p view.frame.origin.x # => 5.0 [/code] Looks like something with accessing structs is broken? -- Ticket URL: <http://www.macruby.org/trac/ticket/1338> MacRuby <http://macruby.org/>
#1338: Can't set origin.x of a NSRect directly ----------------------------------+----------------------------------------- Reporter: martin@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by martin@…): {{{ framework 'Cocoa' view = NSView.alloc.init view.frame.origin.x = 5 p view.frame.origin.x => 0.0 view.frame = [5,0,0,0] p view.frame.origin.x # => 5.0 /code }}} Looks like something with accessing structs is broken? -- Ticket URL: <http://www.macruby.org/trac/ticket/1338#comment:1> MacRuby <http://macruby.org/>
#1338: Can't set origin.x of a NSRect directly ----------------------------------+----------------------------------------- Reporter: martin@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by martin@…): {{{ framework 'Cocoa' view = NSView.alloc.init view.frame.origin.x = 5 p view.frame.origin.x => 0.0 view.frame = [5,0,0,0] p view.frame.origin.x # => 5.0 }}} Looks like something with accessing structs is broken? PS.: Sorry for the wrong formatting three times in a row -- Ticket URL: <http://www.macruby.org/trac/ticket/1338#comment:2> MacRuby <http://macruby.org/>
#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/>
participants (1)
-
MacRuby