splash_window.xml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <class name="SplashWindow">
  2. <relationships>
  3. <inheritance class="tk.Toplevel" priority="1"/>
  4. </relationships>
  5. <constructor>
  6. <super class="tk.TopLevel"/>
  7. <body>
  8. self.progressbar = ttk.Progressbar(self, orient=tk.HORIZONTAL, length=400)
  9. self.progressbar.pack()
  10. self.current = 0
  11. </body>
  12. </constructor>
  13. <destructor>
  14. <body>
  15. self.destroy()
  16. </body>
  17. </destructor>
  18. <scxml initial="root">
  19. <state id="root">
  20. <transition event="update_status" target=".">
  21. <parameter name="value"/>
  22. <parameter name="text"/>
  23. <script>
  24. delta = value - self.current
  25. self.progressbar.step(delta)
  26. self.current += delta
  27. #TODO update text as well
  28. print(text)
  29. </script>
  30. </transition>
  31. <transition event="close" target="../close"/>
  32. </state>
  33. <state id="close">
  34. <onentry>
  35. <raise event="close_window" scope="broad"/>
  36. </onentry>
  37. </state>
  38. </scxml>
  39. </class>