/src/wrappers/gtk/examples/assistant/assistant_demo.e

http://github.com/tybor/Liberty · Specman e · 67 lines · 12 code · 2 blank · 53 comment · 0 complexity · 0f0fd300e26688ef0b89d242f58f807f MD5 · raw file

  1. class ASSISTANT_DEMO
  2. insert
  3. -- TODO: Implement GTK_APPLICATION, with no undefined features; GTK
  4. -- has undefined features. Currently ANY must be inserted alongside
  5. -- with GTK in all effective classes otherwise they will contain
  6. -- undefined features, making them actually deferred.
  7. GTK
  8. ANY
  9. creation make
  10. feature
  11. make is
  12. do
  13. gtk.initialize
  14. create assistant.make
  15. create front_label.with_markup_label
  16. ("<span size='xx-large'>Welcome to the SmartEiffel Integrated Development Enviroment!</span>\n<span size='large'>Please choose the behaviour you prefers in the following pages.</span>")
  17. front_label.set_fill_justify
  18. front_label.set_line_wrap
  19. create table.make (2,2,True)
  20. create label1.with_label("Foo-ness:")
  21. create label2.with_label("Bar-ness:")
  22. create entry1.make entry1.set_text("Absolutely foo!")
  23. create entry2.make entry2.set_text("No bars at all!")
  24. table.attach_defaults(label1, 0,1,0,1)
  25. table.attach_defaults(entry1, 1,2,0,1)
  26. table.attach_defaults(label2, 0,1,1,2)
  27. table.attach_defaults(entry2, 1,2,1,2)
  28. create font_chooser.make
  29. create color_chooser.make
  30. assistant.append(front_label)
  31. assistant.append(table)
  32. assistant.append(font_chooser)
  33. assistant.append(color_chooser)
  34. assistant.set_page_type(front_label, gtk_assistant_page_intro)
  35. assistant.set_page_type(table,gtk_assistant_page_content)
  36. assistant.set_page_type(font_chooser,gtk_assistant_page_content)
  37. assistant.set_page_type(color_chooser,gtk_assistant_page_confirm)
  38. assistant.set_page_title(front_label,"SmartEiffel IDE: first time settings")
  39. assistant.set_page_title(table,"Foo and bar-ness")
  40. assistant.set_page_title(font_chooser,"Default font")
  41. assistant.set_page_title(color_chooser,"Default color")
  42. assistant.set_page_complete(front_label,True)
  43. assistant.set_page_complete(table,True)
  44. assistant.set_page_complete(font_chooser,True)
  45. assistant.set_page_complete(color_chooser,True)
  46. assistant.show_all
  47. gtk.run_main_loop
  48. end
  49. front_label, label1, label2: GTK_LABEL
  50. table: GTK_TABLE
  51. entry1,entry2: GTK_ENTRY
  52. font_chooser: GTK_FONT_SELECTION
  53. color_chooser: GTK_COLOR_SELECTION
  54. assistant: GTK_ASSISTANT
  55. end