View Single Post
Posts: 308 | Thanked: 62 times | Joined on Jun 2009 @ Turkiye
#10
class gui(threading.Thread):
__def __init__(self):
____self.a=0
____.......
____self.entrybox=self.wTree.get_widget('entry2')
____threading.Thread.__init__(self)
__def run(self):
____while 1:
______print self.a
______self.entrybox.set_text(a)
______self.a=self.a+1

gui().start()
gtk.main()

it is not working this way either

EDIT:
from bluetooth import *

class gui(threading.Thread):
__def __init__(self):
____.......
____self.entrybox=self.wTree.get_widget('entry2')
____self.sock=BluetoothSocket(RFCOMM)
____self.sock.connect((host,port))
____print 'connected'

____threading.Thread.__init__(self)
__def run(self):
____while 1:
______data=self.sock.recv(1024)
______self.entrybox.set_text(data)


gui().start()
gtk.main()

what i want is to set this device to send and get data whenever it wants.
i got a button in gui that starts send function and it work OK
but problem is whole about this reading function :/

Last edited by McLightning; 2010-04-03 at 14:21.