123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <class name="ProgressBar">
- <relationships>
- <inheritance class="SCCDWidget" priority="0"/>
- <inheritance class="ttk.Progressbar" priority="1"/>
- <association name="parent" class="A"/>
- </relationships>
- <constructor>
- <parameter name="params"/>
- <super class="ttk.Progressbar">
- <parameter expr="params['parent']"/>
- <parameter expr="**({'orient': tk.HORIZONTAL})"/>
- </super>
- <super class="SCCDWidget"/>
- <body>
- self.value = tk.DoubleVar()
- self.configure(variable=self.value)
- </body>
- </constructor>
- <destructor>
- <body>
- self.destroy()
- </body>
- </destructor>
- <scxml initial="root">
- <state id="root" initial="initializing">
- <state id="initializing">
- <transition target="../ready">
- <raise event="tk_widget" scope="narrow" target="'parent'">
- <parameter expr="self"/>
- </raise>
- </transition>
- </state>
- <state id="ready">
- <transition event="update_status" target=".">
- <parameter name="value"/>
- <parameter name="text"/>
- <script>
- #TODO update text as well
- self.value.set(value)
- print("%s percent -- %s" % (self.value.get(), text))
- </script>
- </transition>
- </state>
- </state>
- </scxml>
- </class>
|