[MacRuby-devel] Obj-C translation

Frisco Del Rosario frisco at laszlomail.com
Fri Apr 3 01:11:04 PDT 2009




On Thu, Apr 2, 2009 at 1:11 PM , John Shea wrote:

> if you look about a quarter of the way down this page ( the 
> introductory tutorial)
> http://www.macruby.org/documentation/tutorial.html 
> <http://www.macruby.org/documentation/tutorial.html>  you will see it 
> all explained.  <http://www.macruby.org/documentation/tutorial.html>

I'd rtfm, but comprehended none of it, it seems.

> <http://www.macruby.org/documentation/tutorial.html>  In this case: 
> <http://www.macruby.org/documentation/tutorial.html> - 
> (BOOL)windowShouldZoom:(NSWindow *)window 
> toFrame:(NSRect)proposedFrame 
> <http://www.macruby.org/documentation/tutorial.html> could become: 
> <http://www.macruby.org/documentation/tutorial.html> 
> windowShouldZoom(window,  toFrame:proposedFrame) 
> <http://www.macruby.org/documentation/tutorial.html>

Got it! Now moving on to this delegate method — in Cocoa Programming 
Quick Start, Daniel H. Steinberg gives:

- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title 
forFrame:(WebFrame *)frame {
[[sender window] setTitle:title];
}

Which I  translated as:

def didReceiveTitle(title, forFrame:frame)
      sender.window(setTitle:title)
end

That should be correct. But what might be the cause for the delegate 
method never to be triggered? (That is, the window title never changes.)

Thank y'all for your help, and for putting up with an old dog trying to 
learn new stuff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20090403/98877f26/attachment.html>


More information about the MacRuby-devel mailing list