Permalink
Browse files

Reworked chapter 00506 - 00515, edited acknowledgments

  • Loading branch information...
1 parent a7bbab4 commit 2052d4fbc132b33373c855965ab045a3c87b62e0 @citizen428 citizen428 committed Feb 17, 2009
View
@@ -1,5 +1,6 @@
Change log:
-----------
+Feb 17th, 2009: citizen428: edited chapters 00506 to 00515. <br>
Feb 16th, 2009: Merged citizen428's pull requests edited 00501 to 00505 and added sample 30-1, a tip of COLORS, into 00516. <br>
Feb 12th, 2009: Merged citizen428's pull requests edited 00300 to 00410. <br>
Feb 10th, 2009: Clarified link to installation instructions in chapter 00200. <br>
@@ -15,16 +15,16 @@ Scope: A tip about using YAML files
![sample19.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample19.png)
The top-level namespace in any Shoes app is Shoes <br>
-so in sample19.rb <br>
+so in the sample <br>
Gang = Struct.new :name, :country <br>
-It really make a Shoes::Gang struct, not a Gang struct, <br>
-so change that line to this and it (sample19-1.rb) works well. <br>
+we actually create a Shoes::Gang struct, not a Gang struct. <br>
+To achieve the desired behavior, we will have to modify the statement like this (see sample19-1.rb). <br>
::Gang = Struct.new :name, :country <br>
-Modified code is
+Here you can see the updated example:
# sample19-1.rb
@@ -1,8 +1,7 @@
keypress, mouse and clipboard
-----------------------------
-We can get mouse events.
-We can get a string from the system clipboard and also store a string into the clipboard.
+A Shoes proggram can react to mouse events and interact with the system's clipboard.
# sample20.rb
Shoes.app :title => 'Sorter', :width => 180, :height => 80 do
@@ -25,9 +24,9 @@ We can get a string from the system clipboard and also store a string into the c
![sample20.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample20.png)
-An example of the output. <br>
+Let's hee see how this program manipulates the clipboard <br>
-before: <br>
+*Before:* <br>
Creatures name list is: <br>
looginkff <br>
cy <br>
@@ -37,21 +36,20 @@ shaha <br>
Copy the above list into the system clipboard. <br>
Click Yar and she will rotate (\*1). <br>
-Then paste the clipboard text into the place you want. <br>
+Paste the clipboard text into the place you want. <br>
-\*1: With Shoes-0.r925, Yar rotates well as expected. But with Shoes-0.r970, Yar rotates when the mouse moves out of the Shoes window. This behavior is a bug. It has been fixed in Shoes-0.r1057. <br>
-Oops, Shoes-0.r1091 behaves as same as Shoes-0.r970. Maybe it's a bug again...
+\*1: With Shoes-0.r925, Yar rotates as expected, but with Shoes-0.r970, Yar rotates when the mouse moves out of the Shoes window. This behavior is a bug. It has been fixed in Shoes-0.r1057. <br>
-after: <br>
+*After:* <br>
Creatures name list is: <br>
cy <br>
kamome <br>
loogink <br>
shaha <br>
yar <br>
-We can get keypress events. <br>
+How to work with keypress events: <br>
# sample21.rb
Shoes.app :width => 250, :height => 40 do
@@ -66,12 +64,11 @@ We can get keypress events. <br>
ATTENTION
---------
-I'm not sure why... But may be a bug of Shows, I guess...
+Please be aware of the following behavior which may be cause by a bug in Shoes:
-See the following snippet. <br>
-Case 1,3,4 will crash. Only case 2 is okay (not crash). Because it creates a new empty String object `''`, then assigns it to the `self.clipboard` instead of `p2.text` itself.
+In the following code snippet, cases 1, 3 and 4 will crash. Case 2 works because it creates a new empty string object ('') which it assigns to `self.clipboard` instead of `p2.text` in case the latter is empty.
-*I noticed this problem when I read the code of [rotten.rb](http://github.com/citizen428/littlesteps/blob/c15ee6a7838b962cbc64bbf3c1570d116bd9c9c1/rotten/rotten.rb) created by [Michael Kohl](http://citizen428.net/).*
+*This problem was discovered in the code of [rotten.rb](http://github.com/citizen428/littlesteps/blob/c15ee6a7838b962cbc64bbf3c1570d116bd9c9c1/rotten/rotten.rb) created by [Michael Kohl](http://citizen428.net/). It does not seem to affect Shoes on Mac OS X where the program is developed.*
# sample65.rb
Shoes.app :width => 400, :height => 50 do
@@ -1,4 +1,4 @@
-the Widget class
+The Widget class
----------------
A custom Shoes widget is set up by inheriting from the Widget class.
@@ -37,8 +37,8 @@ Shoes then creates a method using the lowercased name of the class which is used
One more example
----------------
-We can use __:left__ and __:top__ without definition in the custom class attributes.
-Because inherited from Shoes::Widget.
+We can use __:left__ and __:top__ without definition in the custom class attributes,
+because they are inherited from Shoes::Widget.
# sample49.rb
class Shoes::Widgy < Shoes::Widget
@@ -62,4 +62,4 @@ Because inherited from Shoes::Widget.
![sample49.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample49.png)
-*Original idea is provided by Emanue Carnevale, in the Shoes ML.*
+*Original idea was provided by Emanue Carnevale, in the Shoes ML.*
View
@@ -1,8 +1,7 @@
shape
-----
-We can make arbitrary shapes,
-beginning at coordinates (left, top).
+We can create arbitrary shapes, starting at the coordinates (left, top).
# sample23.rb
Shoes.app :width => 140, :height => 120 do
@@ -19,13 +18,12 @@ beginning at coordinates (left, top).
![sample23.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample23.png)
-Oops, with Shoes-0.r925, it doesn't work well. <br>
-I'm not sure this behavior is the new spec or bug... <br>
-The above screenshot is with Shoes-0.r905. <br>
+There seems to be a bug with Shoes-0.r925. Please note the difference in the two screenshots,
+where the above was taken using Shoes-0.r905 and the second one using Shoes-0.r925.
**sample23-1.png**
![sample23-1.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample23-1.png)
-With Shoes-0.r970, it works well. Although it is a little bit different than the above pic... <br>
-After Shoes-0.r1057, it works like Shoes-0.r970. <br>
+From Shoes version 0.r-970 it seems to be working again, although the result doesn't exactly
+look like the first image. After Shoes-0.r970 we are back to the 0.r-925 behavior.
View
@@ -1,10 +1,9 @@
mask
----
-We can use a masking layer. See the following information.
+The use of a masking layer is described by Shoes' author _why in the folling article:
-Cut Holes In Shoes And Get A Mask <br>
-<http://hackety.org/2007/08/28/cutHolesInShoesAndGetAMask.html> <br>
+[Cut Holes In Shoes And Get A Mask](http://hackety.org/2007/08/28/cutHolesInShoesAndGetAMask.html)
# sample24.rb
Shoes.app :width => 160, :height => 80 do
@@ -1,8 +1,8 @@
Drawing directly onto images
-----------------------------
-We can add elements to images. <br>
-In the sample app below, Cy (green creature) has a star! <br>
+It's possible to add elements to an image. <br>
+In the following example Cy (the green creature) had a star added to it.
# sample25.rb
@@ -32,6 +32,6 @@ In the sample app below, Cy (green creature) has a star! <br>
![sample25.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample25.png)
-If you are using Shoes-0.r970, you need move the mouse off of the image once. After that it works well. <br>
-With Shoes-0.r1057, there is no need to do that.
+Please note that if you are using Shoes-0.r970, you need to move the mouse off the image once. After that it will works as expected. <br>
+With Shoes-0.r1057, there is no need to do this.
View
@@ -1,7 +1,7 @@
Style
-----
-We can change the style of the element with the style method. Calling the style method with no arguments returns a hash of the styles presently applied to the element.
+We can change the style of an element with the style method, whereas calling the method without arguments returns a hash of the styles presently applied to the element.
More information can be found in section 6.3, Styling Master List
@@ -42,8 +42,7 @@ More information can be found in section 6.3, Styling Master List
![sample26.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample26.png)
-We can style an entire class of elements at a time. :-D <br>
-But slot-by-slot would be impossible now. :(
+We can style an entire class of elements at a time like this: <br>
# sample56.rb
Shoes.app :width => 200, :height => 160 do
@@ -60,4 +59,3 @@ But slot-by-slot would be impossible now. :(
![sample56.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample56.png)
-
@@ -1,10 +1,9 @@
Shoes.setup
-----------
-If your Shoes app requires some libraries, this might be useful. See the following information.
+If your Shoes app requires some libraries, this might be useful. See the following information:
-Clearing Up The Whole Shoes And RubyGems Deal <br>
-<http://hackety.org/2008/05/08/clearingUpTheWholeShoesAndRubyGemsDeal.html> <br>
+[Clearing Up The Whole Shoes And RubyGems Deal](http://hackety.org/2008/05/08/clearingUpTheWholeShoesAndRubyGemsDeal.html)
# sample27.rb
@@ -40,4 +39,4 @@ One more example
![sample50.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample50.png)
-*Original snippet was written by Massimiliano in the personal mail discussion.*
+*Original snippet was written by Massimiliano in a personal mail discussion.*
@@ -1,8 +1,10 @@
Downloader
----------
-The methods download and progress are so cool. <br>
-Although percent and length methods don't work well now, transferred and fraction work well. <br>
+This method starts a download thread running in the background and displays a handy progress bar.
+Please keep in mind that the 'percent' and 'length' methods don't seem to work well at this time,
+whereas 'transferred' and 'fraction' do.
+
# sample28.rb
Shoes.app :width => 450, :height => 100 do
@@ -26,5 +28,5 @@ Although percent and length methods don't work well now, transferred and fractio
![sample28.png](http://github.com/ashbb/shoes_tutorial_html/raw/master/images/sample28.png)
-For more information about downloader, see the built-in manual. <br>
Shoes includes the Hpricot library for parsing HTML. <br>
+For more information about downloader, please consult the Shoes manual. <br>
@@ -3,7 +3,7 @@ Assign Shoes URLs dynamically
We can use regular expressions to assign Shoes URLs dynamically. <br>
Shoes passes the match data to the method as the argument. <br>
-The following sample code revises the above sample11.rb. <br>
+The following sample code modifies sample11.rb from before. <br>
# sample29.rb
class PhotoFrame < Shoes
@@ -29,4 +29,3 @@ The following sample code revises the above sample11.rb. <br>
Shoes.app :width => 200, :height => 120, :title => 'Photo Frame'
# sample29.png <br>
-is almost the same as the above sample11.png. <br>
@@ -1,8 +1,12 @@
Acknowledgment
--------------
-Under consideration... :)
-*memo*
+*Authors:*
+
+Satoshi Asakaw (aka ashbb): main author
+Michael Kohl (aka citizen428): corrections, additions, clarifications
+
+*Contributors:*
- Peter corrected the shoes\_course\_text file.
- Michele corrected the ReadMeFirst file.

0 comments on commit 2052d4f

Please sign in to comment.