Edouard@1157: <?xml version="1.0" encoding="UTF-8" standalone="no"?> Edouard@1157: <PyFile> Edouard@1157: <variables/> Edouard@1157: <globals> Edouard@1157: <![CDATA[ Edouard@1157: from threading import Thread Edouard@1157: Edouard@1157: def OnConnectButton(self, event): Edouard@1157: def OnWiiConnected(mac_addr): Edouard@1157: self.label_2.SetLabel( Edouard@1157: "Wiimote %s connected"%mac_addr Edouard@1157: if mac_addr else Edouard@1157: "Wiimote connection failed !") Edouard@1157: Edouard@1157: def WiiConnected(mac_addr): Edouard@1157: wx.CallAfter(OnWiiConnected,mac_addr) Edouard@1157: Edouard@1157: Thread(target = Connect_Wiimote, args = (WiiConnected,)).start() Edouard@1157: self.label_2.SetLabel("Press wiimote 1+2") Edouard@1157: event.Skip() Edouard@1157: Edouard@1157: def OnDisconnectButton(self, event): Edouard@1157: Disconnect_Wiimote() Edouard@1157: self.label_2.SetLabel("Wiimote disconnected") Edouard@1157: event.Skip() Edouard@1157: Edouard@1157: ]]> Edouard@1157: </globals> Edouard@1157: <init> Edouard@1157: <![CDATA[ Edouard@1157: ]]> Edouard@1157: </init> Edouard@1157: <cleanup> Edouard@1157: <![CDATA[ Edouard@1157: ]]> Edouard@1157: </cleanup> Edouard@1157: <start> Edouard@1157: <![CDATA[ Edouard@1157: ]]> Edouard@1157: </start> Edouard@1157: <stop> Edouard@1157: <![CDATA[ Edouard@1157: ]]> Edouard@1157: </stop> Edouard@1157: </PyFile>