shoes3 icon indicating copy to clipboard operation
shoes3 copied to clipboard

Shoes App, Window and Dialog finish events are not working

Open IanTrudel opened this issue 10 years ago • 1 comments

Shoes App, Window and Dialog finish events are not working. The following code should cause an alert to pop up when each window is closed but the finish event is never fired up.

Shoes.app(:title => "Shoes Events", :width => 450, :height => 250) {
   start { |n| para "starting #{n}\n" }
   finish { |n| alert "finishing #{n}" }
   window(:title => "Window Events", :resizable => false) {
      finish { |n| alert "finishing #{n}" }
   }
   dialog(:title => "Dialog Events", :resizable => false) {
      finish { |n| alert "finishing #{n}" }
   }
}

TEMPORARY WORKAROUND

Shoes.app(:title => "Shoes Events", :width => 450, :height => 250) {
   start { |n| para "starting #{n}\n" }
   stack { finish { |n| alert "finishing #{n}" } }
}

IanTrudel avatar Jan 13 '15 23:01 IanTrudel

A slightly more useful example

Shoes.app(:title => "Shoes Events", :width => 450, :height => 250) {
   start { |n| para "starting #{n}\n" }
   stack { finish { |n| alert "finishing #{n}" } }
   window(:title => "Window Events", :resizable => false) {
     stack do
      finish { |n| alert "finishing #{n}" }
     end
   }
}

start and finish(in particular) don't work with the 'default' slot setup of Shoes.app. I know of cases where the default is sometimes a flow and sometimes it's a stack and sometimes (this case) it's neither.

As you've noted in other bug reports, Shoes.app, APPS[], and self.app are confusing and insufficient in documentation and lacking functionality. It's always been a confusing area in Shoes.

ccoupe avatar Sep 12 '15 04:09 ccoupe