/src/wrappers/gtk/examples/entry_completion/entry_completion_demo.e

http://github.com/tybor/Liberty · Specman e · 69 lines · 55 code · 14 blank · 0 comment · 2 complexity · b018bd8d1810644b0b35abeb7a73d1f6 MD5 · raw file

  1. indexing
  2. description: "Entry completion demo."
  3. copyright: "[
  4. Copyright (C) 2006 eiffel-libraries team
  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. class ENTRY_COMPLETION_DEMO
  19. insert
  20. GTK
  21. G_TYPES
  22. ANY
  23. creation make
  24. feature
  25. make is
  26. do
  27. gtk.initialize
  28. create window.make
  29. window.set_title (title_string)
  30. window.midscreen
  31. create entry_box.make (True,10)
  32. create entry_label.with_label ("Programmer's name:")
  33. create entry.make
  34. entry_box.pack_start_defaults (entry_label)
  35. entry_box.pack_start_defaults (entry)
  36. window.add(entry_box)
  37. window.show_all
  38. window.connect_agent_to_destroy_signal (agent on_destroy_window(?))
  39. gtk.run_main_loop
  40. end
  41. on_destroy_window (an_obj: GTK_OBJECT) is
  42. local a_win: GTK_WINDOW
  43. do
  44. a_win ::= an_obj
  45. print ("Quitting%N")
  46. gtk.quit
  47. end
  48. feature -- labels
  49. title_string: STRING is "Completion entry demo"
  50. feature -- Widgets
  51. window: GTK_WINDOW
  52. entry_box: GTK_HBOX
  53. entry_label: GTK_LABEL
  54. entry: PROGRAMMERS_ENTRY
  55. end