Problem with Thread on W2k.a Bug ?

Bach bachhx at mail.ru
Tue Mar 11 07:33:50 CET 2003


1)  This program not work correctly on Win2k ,but work on Linux.I
think it is a bug in thread or in Tix.Dialog for Window systems:
 import thread,Tix,time
 from Dialog import Dialog
 class SomeClass:
   def __init__(self):
      top=Tix.Toplevel()
      bt=Tix.Button(top,text="CallFun",command=self.onCall)
      bt.pack()
      self.val=0
      thread.start_new(self.process,(0,))
   def onCall(self):
      self.val=1

    def process(self):
       while 1:
           if self.val==1:
                app.dialog()
                self.val=0
            time.sleep(0.01)



class App:
    def __init__(self):
         cl=SomeClass()
     def dialog(self):
         Dialog(root,bitmap="info",title="Title",default=0,strings=("Yes",Nine))
 ##**


root=Tix.Tk()
app=App()
root.mainloop()

2)If instead ** (Dialog(root,....) put print "Something" then program
work perfectly.
 Who does know it ?.Help me!

  Regards
 Hoang X B




More information about the Python-list mailing list