glimmer-dsl-libui 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/VERSION +1 -1
- data/examples/color_the_circles.rb +17 -20
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/libui/control_proxy/area_proxy.rb +13 -2
- data/lib/glimmer/libui/control_proxy/window_proxy.rb +0 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2d658816439f96cc50c56c93adb7a41798defb44470f47101d65d64fc09bb0d
|
4
|
+
data.tar.gz: 37abc1ee1f738d73110b9de2e5e9648c0f20d1a81fc928101b6f4d8bf5ca8e85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7cbb8b5b0a37fef0d7ac89e4ddc7a18a73d9be0d82dbc58d801cc4a4bc1504dd60f803c8268083eb96fc52c2e807cbd300689a3744c9f43c7b5f1f15c778902
|
7
|
+
data.tar.gz: 63cfe0c72200e81b196e5cc4fa47473239bc2919db52c027abc5f62ea8de48573a793174d6d61fd2852cc2e19bbb0a5466f0fb6a881af7075bb1e8307c364384
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.2.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.2.2
|
2
2
|
## Prerequisite-Free Ruby Desktop Development GUI Library
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
|
4
4
|
[![Maintainability](https://api.codeclimate.com/v1/badges/ce2853efdbecf6ebdc73/maintainability)](https://codeclimate.com/github/AndyObtiva/glimmer-dsl-libui/maintainability)
|
@@ -197,7 +197,7 @@ Other [Glimmer](https://rubygems.org/gems/glimmer) DSL gems you might be interes
|
|
197
197
|
|
198
198
|
## Table of Contents
|
199
199
|
|
200
|
-
- [Glimmer DSL for LibUI 0.2.
|
200
|
+
- [Glimmer DSL for LibUI 0.2.2](#-glimmer-dsl-for-libui-022)
|
201
201
|
- [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts)
|
202
202
|
- [Usage](#usage)
|
203
203
|
- [Girb (Glimmer IRB)](#girb-glimmer-irb)
|
@@ -331,7 +331,7 @@ gem install glimmer-dsl-libui
|
|
331
331
|
Or install via Bundler `Gemfile`:
|
332
332
|
|
333
333
|
```ruby
|
334
|
-
gem 'glimmer-dsl-libui', '~> 0.2.
|
334
|
+
gem 'glimmer-dsl-libui', '~> 0.2.2'
|
335
335
|
```
|
336
336
|
|
337
337
|
Add `require 'glimmer-dsl-libui'` at the top, and then `include Glimmer` into the top-level main object for testing or into an actual class for serious usage.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -183,7 +183,7 @@ class ColorTheCircles
|
|
183
183
|
}
|
184
184
|
}
|
185
185
|
|
186
|
-
|
186
|
+
@area = area {
|
187
187
|
left 0
|
188
188
|
top 4
|
189
189
|
hexpand true
|
@@ -191,30 +191,27 @@ class ColorTheCircles
|
|
191
191
|
halign :fill
|
192
192
|
valign :fill
|
193
193
|
|
194
|
-
|
195
|
-
|
194
|
+
on_draw do |area_draw_params|
|
195
|
+
path {
|
196
|
+
rectangle(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT)
|
197
|
+
|
198
|
+
fill :white
|
199
|
+
}
|
200
|
+
|
201
|
+
@circles_data.each do |circle_data|
|
196
202
|
path {
|
197
|
-
|
203
|
+
circle_data[:circle] = circle(*circle_data[:args])
|
198
204
|
|
199
|
-
fill :
|
205
|
+
fill circle_data[:fill]
|
206
|
+
stroke circle_data[:stroke]
|
200
207
|
}
|
201
|
-
|
202
|
-
@circles_data.each do |circle_data|
|
203
|
-
path {
|
204
|
-
circle_data[:circle] = circle(*circle_data[:args])
|
205
|
-
|
206
|
-
fill circle_data[:fill]
|
207
|
-
stroke circle_data[:stroke]
|
208
|
-
}
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
on_mouse_down do |area_mouse_event|
|
213
|
-
color_circle(area_mouse_event[:x], area_mouse_event[:y])
|
214
208
|
end
|
215
|
-
|
209
|
+
end
|
210
|
+
|
211
|
+
on_mouse_down do |area_mouse_event|
|
212
|
+
color_circle(area_mouse_event[:x], area_mouse_event[:y])
|
213
|
+
end
|
216
214
|
}
|
217
|
-
|
218
215
|
}
|
219
216
|
}.show
|
220
217
|
end
|
data/glimmer-dsl-libui.gemspec
CHANGED
Binary file
|
@@ -60,7 +60,18 @@ module Glimmer
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def post_add_content
|
63
|
-
|
63
|
+
unless parent_proxy.is_a?(Box)
|
64
|
+
original_parent_proxy = @parent_proxy
|
65
|
+
@vertical_box_parent_proxy = ControlProxy.create('vertical_box', parent_proxy, []) {} # block prevents calling post add content
|
66
|
+
append_properties.each do |property|
|
67
|
+
@vertical_box_parent_proxy.append_property(property, append_property(property))
|
68
|
+
end
|
69
|
+
@vertical_box_parent_proxy.post_add_content
|
70
|
+
@parent_proxy = @vertical_box_parent_proxy
|
71
|
+
@vertical_box_parent_proxy.post_initialize_child(self)
|
72
|
+
else
|
73
|
+
super
|
74
|
+
end
|
64
75
|
install_listeners
|
65
76
|
end
|
66
77
|
|
@@ -72,7 +83,7 @@ module Glimmer
|
|
72
83
|
def redraw
|
73
84
|
queue_redraw_all
|
74
85
|
end
|
75
|
-
|
86
|
+
|
76
87
|
private
|
77
88
|
|
78
89
|
def build_control
|
@@ -35,12 +35,6 @@ module Glimmer
|
|
35
35
|
DEFAULT_HAS_MENUBAR = 1
|
36
36
|
|
37
37
|
def post_initialize_child(child)
|
38
|
-
if child.is_a?(AreaProxy)
|
39
|
-
vertical_box_parent = ControlProxy.create('vertical_box', self, [])
|
40
|
-
child.instance_variable_set(:@parent_proxy, vertical_box_parent)
|
41
|
-
vertical_box_parent.post_initialize_child(child)
|
42
|
-
child = vertical_box_parent
|
43
|
-
end
|
44
38
|
::LibUI.window_set_child(@libui, child.libui)
|
45
39
|
end
|
46
40
|
|