/src/wrappers/gtk/library/close_signal_receiver.e

http://github.com/tybor/Liberty · Specman e · 49 lines · 37 code · 10 blank · 2 comment · 2 complexity · 8c547f2f672bca2d29d768935b52fed4 MD5 · raw file

  1. indexing
  2. description: "Receiver of the close signal."
  3. copyright: "[
  4. Copyright (C) 2006 Paolo Redaelli
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation; either version 2.1 of
  8. the License, or (at your option) any later version.
  9. This library is distributed in the hopeOA that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. deferred class CLOSE_SIGNAL_RECEIVER
  19. inherit GTK_WIDGET
  20. feature -- The "close" signal
  21. close_signal_name: STRING is "close"
  22. enable_on_close is
  23. -- Connects "close" signal to `on_close' feature.
  24. do
  25. connect (Current, close_signal_name, $on_close)
  26. end
  27. on_close is
  28. -- Built-in close signal handler; empty by design; redefine it.
  29. do
  30. end
  31. connect_agent_to_activate_signal (a_procedure: PROCEDURE [ANY, TUPLE[CLOSE_SIGNAL_RECEIVER]]) is
  32. require
  33. valid_procedure: a_procedure /= Void
  34. local close_callback: CLOSE_CALLBACK
  35. do
  36. create close_callback.make
  37. close_callback.connect (Current, a_procedure)
  38. end
  39. end -- class CLOSE_SIGNAL_RECEIVER