green_shoes 0.221.0 → 0.226.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,27 +1,29 @@
1
1
  Green Shoes
2
2
  ===========
3
3
 
4
- Green Shoes is a Ruby DSL for beautiful Desktop Applicatons with a simple syntax.
4
+ > Let's have fun with Ruby and Shoes! :-D
5
+ >
6
+ > [ashbb](#)
7
+
8
+ Green Shoes is a Ruby domain specific language for beautiful Desktop Applications.
9
+ The Green Shoes dsl is so simple, even your pointy haired boss can understand it.
5
10
  The Green Shoes project is based on _why-the-lucky-stiff's Shoes, except for the following:
6
11
 
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.
12
+ * Green Shoes source code is all Ruby, so even you can contribute.
13
+ * Green Shoes takes the Ruby DSL block-style approach, so all you have to do is write what you know: Ruby.
10
14
 
11
- > Let's have fun with Ruby and Shoes! :-D
12
- > - *ashbb*
13
15
 
14
16
  Examples
15
17
  ========
16
18
 
17
19
  Here is a quick example to get the juices flowing:
18
20
 
19
- require 'green_shoes'
21
+ require 'green_shoes'
20
22
 
21
- Shoes.app width: 250, height: 250 do
22
- para "Hello, world!"
23
- image 'images/shoes.png'
24
- end
23
+ Shoes.app( :width => 250, :height => 250 ) do
24
+ para 'Hello, world!'
25
+ image 'images/shoes.png'
26
+ end
25
27
 
26
28
  There are a lot of samples [here in the sample box](https://github.com/ashbb/green_shoes/tree/master/samples).
27
29
 
@@ -29,14 +31,13 @@ There are a lot of samples [here in the sample box](https://github.com/ashbb/gre
29
31
  Installation
30
32
  ============
31
33
 
32
- Installing Green Shoes works like any other Ruby Gem.
33
- This requires three working dependencies:
34
+ Since Green Shoes is a Ruby Gem, all you need to install are:
34
35
 
35
36
  1. [Ruby](http://ruby-lang.org) 1.9 or above
36
37
  2. [Gems](http://rubygems.org) 1.5 or above
37
38
  3. [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) 0.90.7 or above
38
39
 
39
- Once you have all three requirements, you can simply install the gem via Gems:
40
+ Once you have all three requirements, you can simply install with this command:
40
41
 
41
42
  gem install green_shoes
42
43
 
@@ -44,13 +45,17 @@ Once you have all three requirements, you can simply install the gem via Gems:
44
45
  Documentation
45
46
  =============
46
47
 
47
- Check the [Github Wiki](http://github.com/ashbb/green_shoes/wiki) for extra documentation and details.
48
+ Read the [Manual](http://ashbb.github.com/green_shoes/) for all sorts of shoe-like good-ness
49
+
50
+ Check the [Wiki](http://github.com/ashbb/green_shoes/wiki) for extra documentation and details.
51
+
52
+ Please contribute to documentation whenever you can.
48
53
 
49
54
 
50
55
  Bugs & Requests
51
56
  ===============
52
57
 
53
- See [Github Issues](http://github.com/ashbb/green_shoes/issues) for any bugs or feature requests.
58
+ See [Issues](http://github.com/ashbb/green_shoes/issues) for any bugs or feature requests.
54
59
 
55
60
 
56
61
  License
@@ -101,7 +106,7 @@ SOFTWARE.
101
106
  Credits
102
107
  =======
103
108
 
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.
109
+ * [_why-the-lucky-stiff](https://github.com/shoes/shoes), for coming up with the idea and the original shoes.
110
+ * [ashbb](https://github.com/ashbb), for developing Green Shoes.
111
+ * [zzak](https://github.com/zacharyscott), for creating fantastic logo and [web site](http://gshoes.heroku.com/).
112
+ * [krainboltgreene](https://github.com/krainboltgreene), for being terribly handsome.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.221.0
1
+ 0.226.0
data/lib/shoes/basic.rb CHANGED
@@ -81,7 +81,7 @@ class Shoes
81
81
  end
82
82
 
83
83
  def clear
84
- @app.mccs.delete(self); @app.mrcs.delete(self); @app.mmcs.delete(self)
84
+ @app.delete_mouse_events self
85
85
  case self
86
86
  when Button, EditLine, EditBox, ListBox
87
87
  @app.cslot.contents.delete self
@@ -127,6 +127,10 @@ class Shoes
127
127
  layout.attributes = attr_list
128
128
  return layout, context, surface
129
129
  end
130
+
131
+ def delete_mouse_events ele
132
+ [mccs, mrcs, mmcs, mhcs].each{|m| m.delete ele}
133
+ end
130
134
  end
131
135
 
132
136
  def self.contents_alignment slot
data/lib/shoes/ruby.rb CHANGED
@@ -142,6 +142,7 @@ class Array
142
142
 
143
143
  def clear
144
144
  self.each &:clear
145
+ self.delete_if{|x| x or !x}
145
146
  end
146
147
  end
147
148
 
data/lib/shoes/slot.rb CHANGED
@@ -24,7 +24,7 @@ class Shoes
24
24
  BASIC_ATTRIBUTES_DEFAULT.merge! hidden: true
25
25
  SLOT_ATTRIBUTES_DEFAULT.merge! hidden: true
26
26
  @hidden_flag = true unless @parent.instance_variable_get '@hidden'
27
- end
27
+ end
28
28
  yield
29
29
  if @hidden_flag
30
30
  BASIC_ATTRIBUTES_DEFAULT.delete :hidden
@@ -75,8 +75,10 @@ class Shoes
75
75
  def fix_size; end
76
76
 
77
77
  def clear &blk
78
+ @app.delete_mouse_events self
78
79
  @contents.each &:clear
79
80
  @contents.each{|e| @app.mlcs.delete e; @app.mhcs.delete e}
81
+ @contents = []
80
82
  if blk
81
83
  args = {}
82
84
  initials.keys.each{|k| args[k] = instance_variable_get "@#{k}"}
data/lib/shoes/text.rb CHANGED
@@ -15,8 +15,8 @@ class Shoes
15
15
  end
16
16
  end
17
17
 
18
- def link str, &blk
19
- Link.new "#{LINK_DEFAULT}#{str}</span>", &blk
18
+ def link str, arg = {}, &blk
19
+ Link.new "#{LINK_DEFAULT}#{str}</span>", arg, &blk
20
20
  end
21
21
 
22
22
  def font name
@@ -32,8 +32,18 @@ class Shoes
32
32
  end
33
33
 
34
34
  class Link < Text
35
- def initialize str, &blk
36
- @link_proc, @pos, @index, @link_hover = blk, nil, nil, false
35
+ def initialize str, arg, &blk
36
+ @link_proc = if blk
37
+ blk
38
+ elsif arg[:click].is_a? String
39
+ proc{Shoes.APPS.first.app.visit arg[:click]}
40
+ elsif arg[:click].nil?
41
+ proc{}
42
+ else
43
+ arg[:click]
44
+ end
45
+
46
+ @pos, @index, @link_hover = nil, nil, false
37
47
  super str
38
48
  end
39
49
  attr_reader :link_proc
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 221
7
+ - 226
8
8
  - 0
9
- version: 0.221.0
9
+ version: 0.226.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-05-12 00:00:00 +09:00
17
+ date: 2011-06-05 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency