/src/wrappers/gtk/examples/hello/my_window.e

http://github.com/tybor/Liberty · Specman e · 22 lines · 18 code · 3 blank · 1 comment · 1 complexity · 83a51c950ef22a39b718d266bfc784cb MD5 · raw file

  1. class MY_WINDOW
  2. inherit GTK_WINDOW redefine make, on_destroy end
  3. creation make
  4. feature {}
  5. make is
  6. do
  7. Precursor
  8. --enable_on_destroy
  9. create destroy_callback.make
  10. destroy_callback.connect (Current, agent on_destroy)
  11. end
  12. feature -- callback
  13. destroy_callback: DESTROY_CALLBACK
  14. on_destroy is
  15. do
  16. print ("Look! on_destroy at C level is (void (*)) (void*,void*), while at Eiffel level there's only the (hidden) pointer to Current!%NMy window is being destroyed, therefore we quit the application%N")
  17. gtk.quit
  18. end
  19. end