基本上我每次选择Dropbox选项时都会尝试重新打印此方法。但是,:
inscription "test", :margin => 1, :stroke => rgb(x, x, x)
元素不会删除。他们只是适应旧的。在没有清除整个堆栈的情况下,我似乎找不到清除它们的方法!有没有办法将Shoe的clear()用于相同类型的元素?
请注意,很多代码都是其他东西的占位符,这就是为什么我像糖果一样抛出常数。
def drawHeatMap #(calculatedGeneArray) NOT IMPLEMENTED
# rect 'Pixels across, pixels down, width, height'
pixelsAcross = 32
pixelsDown = 28
size = 18
for i in 1..30
if i <= 15
inscription "test", :margin => 1, :stroke => rgb(0, 128, 0)
elsif i > 15
inscription "test", :margin => 1, :stroke => rgb(205, 92, 92)
end
for j in 1..10
stroke rgb(0, 0, 0)
#Fills Blocks randomly
randomnumber = 1+rand(8)
case randomnumber
when 1
fill rgb(19, 231, 3)
when 2
fill rgb(9, 99, 0)
when 3
fill rgb(3, 73, 0)
when 4
fill rgb(74, 74, 0)
when 5
fill rgb(48, 47, 0)
when 6
fill rgb(32, 32, 48)
when 7
fill rgb(41, 41, 41)
when 8
fill rgb(15, 15, 15)
end
rect pixelsAcross, pixelsDown, size, size
#Fills Ovals Randomly
randomnumber = 1+rand(4)
case randomnumber
when 4
fill white
nostroke
oval (pixelsAcross+(size/2)),(pixelsDown+(size/2)), size/4, center:true
end
pixelsAcross += 18
end
pixelsDown += 18
pixelsAcross = 32
end
end
答案 0 :(得分:0)
我不知道你想删除什么以及何时删除,但我认为你可以使用以下原则:
Shoes.app do
a=[]
tmp=para "jkjkj"
a << tmp
tmp=para "sdfg"
a << tmp
button "jhjjh" do
a.each{|l| l.remove}
end
end