hey guys,
i have quit this project so many times but i keep going back. I really need help because im not able to find a solution, or get blocked half way a "solution". I switched to python and im using glade to create my interface. What the msn protocol does is sends information lead by a 3 letter command. To get the users online i would get ILN then the user details. The problem is there is no number specifying the users online so i cant create a loop. I found a solution to that problem or a semi solution since i get my contacts but sometimes missing one or a couple of contacts. My real problem is once i click the button, the program does start the connecting procedures and receives the list. But i cant get the information back, and usually the GUI turns black. Ive read so many tutorials on how to use the threads but cant seem to understand them. Ill attach the two codes if anyone is willing to help?
Code:
import pygtk
import gtk
import gtk.glade
pygtk.require('2.0')
import MSN
import threading
class GUI(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.wTree = gtk.glade.XML("NSN.glade")
btnLogin = self.wTree.get_widget('btnLogin')
self.entryEmail = self.wTree.get_widget('entryEmail')
self.entryPassword = self.wTree.get_widget('entryPassword')
dic = {
"on_btnLogin_clicked" : self.btnLoginClicked,
"gtk_main_quit" : gtk.main_quit
}
self.wTree.signal_autoconnect(dic)
def btnLoginClicked(self,widget):
self.email = self.entryEmail.get_text()
self.password = self.entryPassword.get_text()
msngr = MSN.msn(self.email, self.password)
msngr.start()
#according to a tutorial, this would get the list from the other thread, in the other file MSN.py
uList = Queue.get()
print "from the main: "+userList
if __name__ == "__main__":
app = GUI()
app.start()
gtk.gdk.threads_init()
gtk.main()
Since the MSN.py is too long to be posted, ive attached.
oh btw, ive always wanted to create my own msn thats why i dont want to give up on this. i hope you guys help
Thanks,
Bookmarks