/src/wrappers/gtk/examples/expander/my_expander.e

http://github.com/tybor/Liberty · Specman e · 31 lines · 30 code · 1 blank · 0 comment · 2 complexity · f92e25d384d256dd50e9233a3ceb9af5 MD5 · raw file

  1. class MY_EXPANDER
  2. inherit
  3. GTK_EXPANDER
  4. rename make as make_expander
  5. export {} make_expander
  6. redefine on_activate
  7. end
  8. creation make
  9. feature make (a_statusbar: GTK_STATUS_BAR) is
  10. require valid_statusbar: a_statusbar/=Void
  11. do
  12. statusbar:= a_statusbar
  13. make_with_mnemonic (expander_label)
  14. enable_on_activate
  15. end
  16. on_activate is
  17. require statusbar_set: statusbar /= Void
  18. do
  19. if not statusbar.is_empty then
  20. statusbar.pop
  21. end
  22. if is_expanded then
  23. statusbar.push ("The expander clicked when it was expanded.")
  24. else
  25. statusbar.push ("The expander clicked when it was collapsed.")
  26. end
  27. end
  28. statusbar: GTK_STATUS_BAR
  29. expander_label: STRING is "_An expander"
  30. end