123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
# File 'lib/a-commons.rb', line 123
def float_frame_forge
if @obj.nil?
a = @geometry.scan(/[+-]*\d\d*%*/)
p_height = TkWinfo.screenheight(@arcadia.layout.root)
p_width = TkWinfo.screenwidth(@arcadia.layout.root)
if a[0][-1..-1]=='%'
n = a[0][0..-2].to_i.abs
a[0] = (p_width/100*n).to_i
end
if a[1][-1..-1]=='%'
n = a[1][0..-2].to_i.abs
a[1] = (p_height/100*n).to_i
end
if a[2][-1..-1]=='%'
n = a[2][0..-2].to_i.abs
a[2] = (p_width/100*n).to_i
end
if a[3][-1..-1]=='%'
n = a[3][0..-2].to_i.abs
a[3] = (p_height/100*n).to_i
end
args = {'width'=>a[0], 'height'=>a[1], 'x'=>a[2], 'y'=>a[3]}
@obj = @arcadia.layout.new_float_frame(args)
@obj.title(@title) if @title
end
end
|