| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <class name="Label">
- <relationships>
- <association name="parent" class="A" min="1" max="1" />
- <inheritance class="MvKWidget" priority='0'/>
- <inheritance class="tk.Label" priority='1'/>
- </relationships>
- <constructor>
- <parameter name="constructor_parameters" type="dict" default="{}" />
- <super class="tk.Label">
- <parameter expr="constructor_parameters['parent']"/>
- <parameter expr="**({'text': constructor_parameters['text'], 'bg': 'white'})"/>
- </super>
- <super class="MvKWidget">
- </super>
- <body>
- self.pack()
- </body>
- </constructor>
- <destructor>
- <body>
- self.destroy()
- </body>
- </destructor>
- <method name="set_text">
- <parameter name="text" type="str" />
- <body>
- self.config(text=text)
- </body>
- </method>
- <scxml initial="root">
- <state id="root">
- <state id="running">
- <transition port='input' event="left-click" target='.' cond='tagorid == id(self)'>
- <parameter name='tagorid' type='int' default='None' />
- <raise event="label_pressed" scope="narrow" target="'parent'">
- <parameter expr="self.cget('text')" />
- </raise>
- <script>
- print("Left clicked label!")
- </script>
- </transition>
- <transition event="highlight" target=".">
- <script>
- self.config(bg="yellow")
- </script>
- </transition>
- <transition event="unhighlight" target=".">
- <script>
- self.config(bg="white")
- </script>
- </transition>
- </state>
- </state>
- </scxml>
- </class>
|