Why says that keyboard / mouse events are sent to a slot - however when I try to use two keypress handlers in two stacks I can only get it to handle the first keypress method

Can anyone help?

I just hacked the code from the editor sample:

shoes 0.r683

Shoes.app :height => 500, :width => 450 do
 background rgb(77, 77, 77)
 stack :margin => 10 do
para span("TEXT EDITOR", :stroke => red, :fill => white), " * USE ALT-Q TO QUIT", :stroke => white
 end
 stack :margin => 10 do
   t = para "", :font => "Monospace 12px", :stroke => white
   t.cursor = -1


 keypress do |k|
   case k
   when String
     str += k
   when :backspace
     str.slice!(-1)
   when :tab
     str += "  "
   when :alt_q
     quit
   when :alt_c
     self.clipboard = str
   when :alt_v
     str += self.clipboard
   end
   t.replace str
 end
end

stack :margin => 10 do
   t2 = para "", :font => "Monospace 12px", :stroke => blue
   t2.cursor = -1


 keypress do |k|
   case k
   when String
     str2 += k
   when :backspace
     str2.slice!(-1)
   when :tab
     str2+= "  "
   when :alt_q
     quit
   when :alt_c
     self.clipboard = str
   when :alt_v
     str2 += self.clipboard
   end
   t.replace str2
 end
 end
end

Reply via email to