shul 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/shul.rb +22 -18
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6264c6ebc6265bf41669a6dcbb5f46d4f59142f2
|
4
|
+
data.tar.gz: e31ae1a893abe069a371637309b01f9e4635ff2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06018f1368736724035a1b5242ab14c7e936fcc2925662a38692f3b14527dc0b42f4725d09c80025f499cdb61cf248a2ad9e19ad91ea2a71a8eba235370dfa44
|
7
|
+
data.tar.gz: 88fe48f88f19ac5715c01b0b7ebbd86baefb73d488d31567a9d3497b63834d1fdb248edd5dce408213da945aeb474ba2fa63aac4b22b99352f86e1944686f68a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/shul.rb
CHANGED
@@ -26,8 +26,12 @@ Shoes.app {Shul.new self, xml}
|
|
26
26
|
# https://en.wikipedia.org/wiki/Shoes_%28GUI_toolkit%29
|
27
27
|
# https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL
|
28
28
|
# http://www.xul.fr/tutorial/
|
29
|
+
# https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tutorial/The_Box_Model
|
29
30
|
# shoes:
|
30
31
|
# http://shoesrb.com/manual/Element.html
|
32
|
+
# http://shoesrb.com/manual/App.html
|
33
|
+
# http://shoesrb.com/manual/Slots.html (floww or stacks)
|
34
|
+
# http://shoesrb.com/manual/Events.html
|
31
35
|
#------------------------------------------------------------------
|
32
36
|
|
33
37
|
require 'rexle'
|
@@ -77,22 +81,33 @@ module Shul
|
|
77
81
|
|
78
82
|
sleep 0.0001
|
79
83
|
|
80
|
-
box = doc.root.element('hbox | vbox')
|
84
|
+
box = doc.root.element('hbox | vbox')
|
85
|
+
wdth, hght = find_max_dimensions(box)
|
81
86
|
|
82
|
-
h = {title: 'Shul', width:
|
87
|
+
h = {title: 'Shul', width: wdth, height: hght}\
|
83
88
|
.merge doc.root.attributes
|
84
|
-
|
89
|
+
|
85
90
|
win = window(h) { Window.new self, doc }
|
86
|
-
|
87
|
-
sleep 0.0001
|
88
|
-
|
89
|
-
end
|
91
|
+
|
90
92
|
app.close # closes the initial shoes app
|
91
93
|
shul = nil
|
92
94
|
|
93
95
|
end
|
94
96
|
end
|
95
97
|
|
98
|
+
private
|
99
|
+
|
100
|
+
def find_max_dimensions(e)
|
101
|
+
|
102
|
+
a = e.elements.map(&:obj)
|
103
|
+
|
104
|
+
maxwidth = a.max_by{|x| x.width}.width
|
105
|
+
maxheight = a.inject(0) {|r,x2| r += x2.height }
|
106
|
+
|
107
|
+
[maxwidth, maxheight]
|
108
|
+
|
109
|
+
end
|
110
|
+
|
96
111
|
end
|
97
112
|
|
98
113
|
class Window
|
@@ -112,7 +127,6 @@ module Shul
|
|
112
127
|
self.root.element("//*[@id='#{id}']")
|
113
128
|
end
|
114
129
|
|
115
|
-
|
116
130
|
end
|
117
131
|
|
118
132
|
private
|
@@ -176,16 +190,7 @@ module Shul
|
|
176
190
|
end
|
177
191
|
|
178
192
|
end
|
179
|
-
|
180
|
-
def find_max_dimensions(e)
|
181
|
-
|
182
|
-
a = e.elements.map(&:obj)
|
183
|
-
maxwidth = a.max_by{|x| x.width}.width
|
184
|
-
maxheight = a.inject(0) {|r,x2| r += x2.height }
|
185
|
-
|
186
|
-
[maxwidth.to_i, maxheight]
|
187
193
|
|
188
|
-
end
|
189
194
|
|
190
195
|
# This method is under-development
|
191
196
|
#
|
@@ -285,7 +290,6 @@ module Shul
|
|
285
290
|
end
|
286
291
|
|
287
292
|
def radiogroup(e)
|
288
|
-
|
289
293
|
|
290
294
|
e.xpath('radio').each do |x|
|
291
295
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|