/src/wrappers/gtk/library/select_all_callback.e

http://github.com/tybor/Liberty · Specman e · 68 lines · 52 code · 16 blank · 0 comment · 3 complexity · d1870901d119216253e2cf6d907c020b MD5 · raw file

  1. indexing
  2. description: "Generic callback for the select-all signal"
  3. copyright: "[
  4. Copyright (C) 2006 Paolo redaelli, eiffel-libraries team, GTK+ team and others
  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 hope 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. license: "LGPL v2 or later"
  19. date: "$Date:$"
  20. revision "$Revision:$"
  21. class SELECT_ALL_CALLBACK
  22. inherit CALLBACK redefine object end
  23. insert G_OBJECT_FACTORY [GTK_TEXT_VIEW]
  24. creation make
  25. feature
  26. object: GTK_TEXT_VIEW
  27. feature
  28. callback (select_all: INTEGER; instance: POINTER) is
  29. require
  30. instance_not_null: instance.is_not_null
  31. do
  32. object := wrapper(instance)
  33. procedure.call ([object, select_all.to_boolean])
  34. end
  35. callback_pointer: POINTER is
  36. do
  37. Result := get_callback_pointer ($callback)
  38. ensure
  39. Result.is_not_null
  40. end
  41. connect (an_object: like object; a_procedure: like procedure) is
  42. require
  43. an_object /= Void
  44. a_procedure /= Void
  45. do
  46. handler_id := g_signal_connect_closure (an_object.handle, signal_name.to_external,
  47. handle, 0) -- i.e. call it before default handler
  48. procedure := a_procedure
  49. end
  50. signal_name: STRING is "select-all"
  51. procedure: PROCEDURE [ANY, TUPLE [like object, BOOLEAN]]
  52. end -- class SELECT_ALL_CALLBACK