/src/wrappers/gtk/library/realize_callback.e

http://github.com/tybor/Liberty · Specman e · 70 lines · 53 code · 15 blank · 2 comment · 3 complexity · c6a0a042f1f68fc2b88c9a4a65a07dcd MD5 · raw file

  1. indexing
  2. description: "Generic callback for the realize signal"
  3. copyright: "[
  4. Copyright (C) 2006 Soluciones Informaticas Libres S.A. (except),
  5. eiffel-libraries team, GTK+ team and others
  6. This library is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU Lesser General Public License
  8. as published by the Free Software Foundation; either version 2.1 of
  9. the License, or (at your option) any later version.
  10. This library is distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with this library; if not, write to the Free Software
  16. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  17. 02110-1301 USA
  18. ]"
  19. license: "LGPL v2 or later"
  20. date: "$Date:$"
  21. revision "$Revision:$"
  22. class REALIZE_CALLBACK
  23. inherit
  24. CALLBACK
  25. redefine object end
  26. insert
  27. G_OBJECT_FACTORY [GTK_WIDGET]
  28. creation make
  29. feature
  30. object: GTK_WIDGET
  31. callback (instance: POINTER) is
  32. do
  33. -- The following is written with the implicit requirement
  34. -- that the object is actually created by the Eiffel
  35. object := wrapper(instance)
  36. procedure.call([object])
  37. end
  38. callback_pointer: POINTER is
  39. do
  40. Result := get_callback_pointer ($callback)
  41. ensure
  42. Result.is_not_null
  43. end
  44. connect (an_object: GTK_WIDGET; a_procedure: PROCEDURE [ANY, TUPLE[GTK_WIDGET]]) is
  45. do
  46. handler_id := g_signal_connect_closure (an_object.handle,
  47. signal_name.to_external,
  48. handle,
  49. 1 -- i.e. call it after default handler
  50. )
  51. procedure := a_procedure
  52. end
  53. procedure: PROCEDURE [ANY, TUPLE[GTK_WIDGET]]
  54. signal_name: STRING is "realize"
  55. end -- class REALIZE_CALLBACK