Thread
:
Multitasking and GTK with python
View Single Post
McLightning
2010-04-03 , 14:15
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 :/
__________________
Mplayer Full ShortCut List
http://www.keyxl.com/aaa2fa5/302/MPl...-shortcuts.htm
Mclightning.com
DegCal - Right Triangle Degree Calculator
Last edited by McLightning; 2010-04-03 at
14:21
.
Quote & Reply
|
McLightning
View Public Profile
Send a private message to McLightning
Find all posts by McLightning