On 08/08/13 22:03, SM wrote:

[SM] Sorry that I didn't add that part. setupUI is called from the main
as below:

if __name__ == "__main__":
     import sys
     app = QtGui.QApplication(sys.argv)
     MainWindow = QtGui.QMainWindow()
     ui = Ui_MainWindow()
     ui.setupUi(MainWindow)
     MainWindow.show()
     sys.exit(app.exec_())

Wonder if it is necessary to call it through __init__.

Thats the problem.
You are creating a new instance inside your run() method but
the call in main() only sets it for the instance created in
main. It won't set it up for any other instance. You need
to call it every time you create a new object. Unless....

If you put it in init() it will be called every time you
create a new instance. Much safer.


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to