12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <class name="SplashWindow">
- <relationships>
- <inheritance class="tk.Toplevel" priority="1"/>
- </relationships>
- <constructor>
- <super class="tk.TopLevel"/>
- <body>
- self.progressbar = ttk.Progressbar(self, orient=tk.HORIZONTAL, length=400)
- self.progressbar.pack()
- self.current = 0
- </body>
- </constructor>
- <destructor>
- <body>
- self.destroy()
- </body>
- </destructor>
- <scxml initial="root">
- <state id="root">
- <transition event="update_status" target=".">
- <parameter name="value"/>
- <parameter name="text"/>
- <script>
- delta = value - self.current
- self.progressbar.step(delta)
- self.current += delta
- #TODO update text as well
- print(text)
- </script>
- </transition>
- <transition event="close" target="../close"/>
- </state>
- <state id="close">
- <onentry>
- <raise event="close_window" scope="broad"/>
- </onentry>
- </state>
- </scxml>
- </class>
|