shul 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/shul.rb +22 -18
  5. metadata +1 -1
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 250018912dfe1c289cdcc291096db3b888153a1b
4
- data.tar.gz: e2be69b41bd343e9702c403ce36757c4de1957f8
3
+ metadata.gz: 6264c6ebc6265bf41669a6dcbb5f46d4f59142f2
4
+ data.tar.gz: e31ae1a893abe069a371637309b01f9e4635ff2d
5
5
  SHA512:
6
- metadata.gz: 5628cbfca17f5396003eec25ffef3691a25d87e84d100a8f3af618aa4b7f1f74aa40213feca23f8a73f09a88dbfb21679cdda06e504ccbca236973575abfabd6
7
- data.tar.gz: c2dc301eb0a14c52bfc87fda3a5c3b79e4c1ab964f5ea660962594fc78683aa5a8f2b7ae5e6e35b181cec7f72c732a13b9aa9051df8ecc3d0d12b81b19fa4ea6
6
+ metadata.gz: 06018f1368736724035a1b5242ab14c7e936fcc2925662a38692f3b14527dc0b42f4725d09c80025f499cdb61cf248a2ad9e19ad91ea2a71a8eba235370dfa44
7
+ data.tar.gz: 88fe48f88f19ac5715c01b0b7ebbd86baefb73d488d31567a9d3497b63834d1fdb248edd5dce408213da945aeb474ba2fa63aac4b22b99352f86e1944686f68a
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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').obj
84
+ box = doc.root.element('hbox | vbox')
85
+ wdth, hght = find_max_dimensions(box)
81
86
 
82
- h = {title: 'Shul', width: box.width, height: box.height}\
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
- win.start do |w|
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file