green_shoes 0.214.0 → 0.221.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +39 -77
- data/VERSION +1 -1
- data/lib/shoes/app.rb +2 -0
- data/lib/shoes/ruby.rb +8 -0
- data/lib/shoes/widget.rb +4 -1
- data/static/manual-en.txt +7 -4
- metadata +3 -3
data/README.md
CHANGED
|
@@ -1,96 +1,60 @@
|
|
|
1
1
|
Green Shoes
|
|
2
2
|
===========
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Green Shoes is a Ruby DSL for beautiful Desktop Applicatons with a simple syntax.
|
|
5
|
+
The Green Shoes project is based on _why-the-lucky-stiff's Shoes, except for the following:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
* Green Shoes's source is in Ruby.
|
|
8
|
+
* Green Shoes's DSL is all Ruby, so you can write Ruby.
|
|
9
|
+
* Green Shoes is green.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
> Let's have fun with Ruby and Shoes! :-D
|
|
12
|
+
> - *ashbb*
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Examples
|
|
15
|
+
========
|
|
12
16
|
|
|
17
|
+
Here is a quick example to get the juices flowing:
|
|
13
18
|
|
|
14
|
-
Tiny Streaming Flash videos
|
|
15
|
-
---------------------------
|
|
16
|
-
|
|
17
|
-
- [sample01](http://www.rin-shun.com/shoes/green-shoes-sample1.swf.html) : Bouncing logo
|
|
18
|
-
- [sample04](http://www.rin-shun.com/shoes/green-shoes-sample4.swf.html) : Text in edit_line moving at random
|
|
19
|
-
- [sample07](http://www.rin-shun.com/shoes/green-shoes-sample7.swf.html) : 20 buttons in flow
|
|
20
|
-
- [sample09](http://www.rin-shun.com/shoes/green-shoes-sample9.swf.html) : Complicated stacks and flows
|
|
21
|
-
- [sample11](http://www.rin-shun.com/shoes/green-shoes-sample11.swf.html) : A circle moving with mouse motion
|
|
22
|
-
- [sample12](http://www.rin-shun.com/shoes/green-shoes-sample12.swf.html) : Random color change
|
|
23
|
-
- [sample13](http://www.rin-shun.com/shoes/green-shoes-sample13.swf.html) : Mouse click and release
|
|
24
|
-
- [sample14-1](http://www.rin-shun.com/shoes/green-shoes-sample14-1.swf.html) : Flowers
|
|
25
|
-
- [sample15](http://www.rin-shun.com/shoes/green-shoes-sample15.swf.html) : Text reallocation
|
|
26
|
-
- [sample18](http://www.rin-shun.com/shoes/green-shoes-sample18.swf.html) : Text markup and link
|
|
27
|
-
- [sample19](http://www.rin-shun.com/shoes/green-shoes-sample19.swf.html) : Pong Game
|
|
28
|
-
- [sample20](http://www.rin-shun.com/shoes/green-shoes-sample20.swf.html) : Potacho
|
|
29
|
-
- [sample26](http://www.rin-shun.com/shoes/green-shoes-sample26.swf.html) : Mask
|
|
30
|
-
- [sample28](http://www.rin-shun.com/shoes/green-shoes-sample28.swf.html) : Snake Game
|
|
31
|
-
- [sample32](http://www.rin-shun.com/shoes/green-shoes-sample32.swf.html) : Chipmunk Physics
|
|
32
|
-
- [sample38](http://www.rin-shun.com/shoes/green-shoes-sample38.swf.html) : Rotating rect, oval and star
|
|
33
|
-
- [sample39](http://www.rin-shun.com/shoes/green-shoes-sample39.swf.html) : Hackety Hack opening demo
|
|
34
|
-
- [sample41](http://www.rin-shun.com/shoes/green-shoes-sample41.swf.html) : 3D Texture Mapping
|
|
35
|
-
- [sample43](http://www.rin-shun.com/shoes/green-shoes-sample43.swf.html) : Download and progress bar
|
|
36
|
-
- [sample44](http://www.rin-shun.com/shoes/green-shoes-sample44.swf.html) : Good clock
|
|
37
|
-
|
|
38
|
-
- [simple boids](http://www.rin-shun.com/shoes/green-shoes-a-very-simple-boids.swf.html) : A very simple boids
|
|
39
|
-
- [parallax scrolling](http://www.rin-shun.com/shoes/green-shoes-parallax-scrolling.swf.html) : Parallax scrolling
|
|
40
|
-
- [search sample](http://www.rin-shun.com/shoes/search_sample_with_green_shoes.swf.html) : Search sample
|
|
41
|
-
|
|
42
|
-
recorded with [CamStudio](http://camstudio.org/).
|
|
43
|
-
|
|
44
|
-
Install and run
|
|
45
|
-
--------------
|
|
46
|
-
|
|
47
|
-
For Windows:
|
|
48
|
-
|
|
49
|
-
1. download and install [rubyinstaller-1.9.2-p136.exe](http://rubyinstaller.org/downloads/)
|
|
50
|
-
2. gem install green_shoes --no-ri --no-rdoc
|
|
51
|
-
|
|
52
|
-
That's it!
|
|
53
|
-
|
|
54
|
-
Now open your text editor and write your first Green Shoes app like this:
|
|
55
|
-
|
|
56
|
-
#my_first_green_shoes_app.rb
|
|
57
19
|
require 'green_shoes'
|
|
58
|
-
|
|
20
|
+
|
|
21
|
+
Shoes.app width: 250, height: 250 do
|
|
22
|
+
para "Hello, world!"
|
|
23
|
+
image 'images/shoes.png'
|
|
24
|
+
end
|
|
59
25
|
|
|
60
|
-
|
|
26
|
+
There are a lot of samples [here in the sample box](https://github.com/ashbb/green_shoes/tree/master/samples).
|
|
61
27
|
|
|
62
|
-
ruby my_first_green_shoes_app.rb
|
|
63
28
|
|
|
64
|
-
|
|
29
|
+
Installation
|
|
30
|
+
============
|
|
65
31
|
|
|
66
|
-
|
|
32
|
+
Installing Green Shoes works like any other Ruby Gem.
|
|
33
|
+
This requires three working dependencies:
|
|
67
34
|
|
|
68
|
-
|
|
35
|
+
1. [Ruby](http://ruby-lang.org) 1.9 or above
|
|
36
|
+
2. [Gems](http://rubygems.org) 1.5 or above
|
|
37
|
+
3. [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) 0.90.7 or above
|
|
69
38
|
|
|
70
|
-
|
|
39
|
+
Once you have all three requirements, you can simply install the gem via Gems:
|
|
71
40
|
|
|
72
|
-
|
|
73
|
-
- store just one line: gtk-theme-name = "MS-Windows"
|
|
41
|
+
gem install green_shoes
|
|
74
42
|
|
|
75
|
-
Then you can look at good-looking button on Green Shoes.
|
|
76
|
-
(left button of [this snapshot](http://www.rin-shun.com/tmp/ruby-gtk2-buttons.png))
|
|
77
43
|
|
|
78
|
-
|
|
79
|
-
|
|
44
|
+
Documentation
|
|
45
|
+
=============
|
|
80
46
|
|
|
47
|
+
Check the [Github Wiki](http://github.com/ashbb/green_shoes/wiki) for extra documentation and details.
|
|
81
48
|
|
|
82
|
-
Mini Hackety Hack
|
|
83
|
-
------------------
|
|
84
49
|
|
|
85
|
-
|
|
50
|
+
Bugs & Requests
|
|
51
|
+
===============
|
|
86
52
|
|
|
87
|
-
[
|
|
53
|
+
See [Github Issues](http://github.com/ashbb/green_shoes/issues) for any bugs or feature requests.
|
|
88
54
|
|
|
89
|
-
[Hackety Hack](http://hacketyhack.heroku.com/): the little coder's starter kit
|
|
90
55
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
--------
|
|
56
|
+
License
|
|
57
|
+
=========
|
|
94
58
|
|
|
95
59
|
Copyright (c) 2010-2011 ashbb
|
|
96
60
|
|
|
@@ -134,12 +98,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
134
98
|
SOFTWARE.
|
|
135
99
|
|
|
136
100
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- [Install Ruby/GTK2 and rcairo for Linux](https://github.com/ashbb/shoes_hack_note/tree/master/md/hack030.md).
|
|
141
|
-
- [Install Ruby/GTK2 and rcairo for Windows](https://github.com/ashbb/shoes_hack_note/tree/master/md/hack031.md).
|
|
142
|
-
|
|
143
|
-
Let's have fun with Ruby and Shoes! :-D
|
|
101
|
+
Credits
|
|
102
|
+
=======
|
|
144
103
|
|
|
145
|
-
|
|
104
|
+
_why-the-lucky-stiff, for coming up with the idea and the original shoes.
|
|
105
|
+
ashbb, for the ... and ...
|
|
106
|
+
zzack, for ... and ...
|
|
107
|
+
krainboltgreen, for being a visionary and glorious leader. Terribly handsome.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.221.0
|
data/lib/shoes/app.rb
CHANGED
|
@@ -73,6 +73,8 @@ class Shoes
|
|
|
73
73
|
args = msg.last.class == Hash ? msg.pop : {}
|
|
74
74
|
args = basic_attributes args
|
|
75
75
|
args[:markup] = msg.map(&:to_s).join
|
|
76
|
+
args[:markup] = fg(args[:markup], tr_color(args[:stroke])) if args[:stroke]
|
|
77
|
+
args[:markup] = bg(args[:markup], tr_color(args[:fill])) if args[:fill]
|
|
76
78
|
text, attr_list = make_pango_attr args[:markup]
|
|
77
79
|
args[:size] ||= font_size
|
|
78
80
|
args[:font] ||= (@font_family or 'sans')
|
data/lib/shoes/ruby.rb
CHANGED
data/lib/shoes/widget.rb
CHANGED
|
@@ -5,7 +5,10 @@ class Shoes
|
|
|
5
5
|
Shoes::App.class_eval do
|
|
6
6
|
define_method m do |*args, &blk|
|
|
7
7
|
klass.class_variable_set :@@__app__, self
|
|
8
|
-
|
|
8
|
+
parent = app.cslot
|
|
9
|
+
klass.new(*args, &blk).tap do |s|
|
|
10
|
+
s.define_singleton_method(:parent){parent}
|
|
11
|
+
end
|
|
9
12
|
end
|
|
10
13
|
end
|
|
11
14
|
klass.class_eval do
|
data/static/manual-en.txt
CHANGED
|
@@ -1304,10 +1304,12 @@ name or a comma-separated list of families.
|
|
|
1304
1304
|
|
|
1305
1305
|
=== :fill » a hex code, a rgb array or a range of either ===
|
|
1306
1306
|
|
|
1307
|
-
For: ''background, border,
|
|
1307
|
+
For: ''background, banner, border, caption, inscription, para, line, oval,
|
|
1308
|
+
rect, shape, star, subtitle, tagline, title''.
|
|
1308
1309
|
|
|
1309
1310
|
The color of the background pen. For shapes, this is the fill color, the paint
|
|
1310
|
-
inside the shape.
|
|
1311
|
+
inside the shape. For textblock, this color is painted in the background
|
|
1312
|
+
(as if marked with a highlighter pen.)
|
|
1311
1313
|
|
|
1312
1314
|
=== :font » a string ===
|
|
1313
1315
|
|
|
@@ -1598,10 +1600,11 @@ Is this text stricken through? Two options here:
|
|
|
1598
1600
|
|
|
1599
1601
|
=== :stroke » a hex code, a rgb array or a range of either ===
|
|
1600
1602
|
|
|
1601
|
-
For: ''background, border,
|
|
1603
|
+
For: ''background, banner, border, caption, inscription, para, line, oval,
|
|
1604
|
+
rect, shape, star, subtitle, tagline, title''.
|
|
1602
1605
|
|
|
1603
1606
|
The color of the foreground pen. In the case of shapes, this is the color the
|
|
1604
|
-
lines are drawn with.
|
|
1607
|
+
lines are drawn with. For textblock, the letters are printed in this color.
|
|
1605
1608
|
|
|
1606
1609
|
=== :strokewidth » a number ===
|
|
1607
1610
|
|
metadata
CHANGED
|
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
|
4
4
|
prerelease: false
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
|
-
-
|
|
7
|
+
- 221
|
|
8
8
|
- 0
|
|
9
|
-
version: 0.
|
|
9
|
+
version: 0.221.0
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- ashbb
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date: 2011-
|
|
17
|
+
date: 2011-05-12 00:00:00 +09:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|