/src/wrappers/gtk/examples/gtk-demo/expander.e

http://github.com/tybor/Liberty · Specman e · 81 lines · 58 code · 23 blank · 0 comment · 5 complexity · 10700c44c6a42e8f9d37158d03915cc8 MD5 · raw file

  1. indexing
  2. description: "."
  3. copyright: "[
  4. Copyright (C) 2006 eiffel-libraries team, GTK+ 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 EXPANDER
  19. inherit DEMO
  20. insert
  21. GTK_RESPONSE_TYPE
  22. GTK_STOCK_ITEMS
  23. creation make
  24. feature
  25. name: STRING is "Expander"
  26. description: STRING is "GtkExpander allows to provide additional content that is initially hidden. This is also known as %"disclosure triangle%"."
  27. filename: STRING is "expander.e"
  28. feature -- widgets
  29. vbox: GTK_VBOX
  30. label: GTK_LABEL
  31. expander: GTK_EXPANDER
  32. feature
  33. make is
  34. do
  35. if window=Void then
  36. create {GTK_DIALOG} window.with_buttons ("GtkExpander", -- Window label
  37. parent_window,
  38. 0, -- no flags
  39. <<gtk_stock_close,
  40. gtk_response_none>>)
  41. window.set_unresizable
  42. create vbox.make (False, 5)
  43. window.vbox.pack_start (vbox, True, True, 0);
  44. vbox.set_border_width (5)
  45. vbox.pack_start (create {GTK_LABEL}.with_label
  46. ("Expander demo. Click on the triangle for details."),
  47. label, False, False, 0)
  48. create expander.make ("Details")
  49. vbox.pack_start (expander, False, False, 0)
  50. expander.add (create {GTK_LABEL}.with_label("Details can be shown or hidden."))
  51. if not window.is_visible then
  52. window.show_all (window)
  53. else
  54. window.destroy
  55. end
  56. end
  57. end
  58. end