[macruby-changes] [2707] MacRubyWebsite/trunk/content/documentation/tutorial.txt
source_changes at macosforge.org
source_changes at macosforge.org
Thu Oct 1 23:38:58 PDT 2009
Revision: 2707
http://trac.macosforge.org/projects/ruby/changeset/2707
Author: mattaimonetti at gmail.com
Date: 2009-10-01 23:38:58 -0700 (Thu, 01 Oct 2009)
Log Message:
-----------
fixed a tutorial display bug thanks to gaustin
Modified Paths:
--------------
MacRubyWebsite/trunk/content/documentation/tutorial.txt
Modified: MacRubyWebsite/trunk/content/documentation/tutorial.txt
===================================================================
--- MacRubyWebsite/trunk/content/documentation/tutorial.txt 2009-10-02 03:43:08 UTC (rev 2706)
+++ MacRubyWebsite/trunk/content/documentation/tutorial.txt 2009-10-02 06:38:58 UTC (rev 2707)
@@ -47,6 +47,7 @@
It is very easy to use an Objective-C class from MacRuby. You just have to refer to it as if it was a Ruby class. For example, to access the NSSound class:
+<code>
<pre class="commands">
$ /usr/local/bin/macirb --simple-prompt
>> framework 'Cocoa'
@@ -54,6 +55,7 @@
>> NSSound.ancestors
=> [NSSound, Object, NSObject, Kernel]
</pre>
+</code>
In MacRuby, all classes, including Ruby core classes, always inherit from NSObject, the root class of most Objective-C classes.
@@ -176,8 +178,8 @@
NSBorderlessWindowMask,
NSBackingStoreBuffered,
false)
-<% end -%>
-
+<% end -%>
+
To call setter methods on Objective-C objects, you normally call a method like setName, using the name as the argument. MacRuby provides a facility which allows the use of standard attribute writer methods:
<% coderay :lang => 'ruby' do -%>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091001/3832cb67/attachment.html>
More information about the macruby-changes
mailing list