<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">Hello all!<br><br>This is my first post in this forum, am really hoping that you guys could help me out. <br><br>I have a PyQt mainwindow app that calls a Tk widget containing a listbox. When I try to resize the Tk widget to a dimension lesser than the size of the listbox (ie make it smaller vertically or horizontally), then the app crashes.<br><br>To give you a better idea, here is the code for the mainwindow app:<br><br>################ pyqt.py ##################################<br><br>import sys<br>from PyQt4 import QtGui<br><br>class MainWindow(QtGui.QMainWindow):<br> def __init__(self):<br> QtGui.QMainWindow.__init__(self)<br><br> self.resize(250, 150)<br>
self.setWindowTitle('statusbar')<br><br> self.showPanel()<br> <br> def showPanel(self):<br> import tkPanel<br> tkPanel.tkPanel()<br> <br>app = QtGui.QApplication(sys.argv)<br>main = MainWindow()<br>main.show()<br>sys.exit(app.exec_())<br><br>######################################################<br><br>And here is the Tkinter widget:<br><br>################### tkPanel.py #########################<br><br>#import sys<br>#sys.argv = [''] <br>import Tkinter as origTk<br><br>def tkPanel():<br><br> window = origTk.Tk()<br> <br> window.title("Toy Program")<br><br> ## Create the main container i.e. topmost frame (a Tkinter Frame)<br> frameDesc = origTk.Frame(window)<br> frameDesc.pack()<br><br> ## Create
Scrollbar for descriptor listbox ( a Tkinter Scrollbar)<br> scrollbar = origTk.Scrollbar(frameDesc) <br> <br> ## Create descriptor Listbox ( a Tkinter Listbox)<br> <br> #list = origTk.Listbox(frameDesc,yscrollcommand=scrollbar.set)<br> <br> scrollbar.config(command=list.yview)<br> scrollbar.pack()<br> list.insert(0,"ABCD")<br> list.insert(1,"ABCD-1")<br> list.insert(2,"ABCD-2")<br> list.pack()<br><br> window.update()<br><br>#######################################################<br><br><br>Now if I run this, using: python pyqt.py, and then drag/resize the Tk widget <br>to a height less that the list size, then it crashes with the message:<br><br>Fatal Python error: PyEval_RestoreThread: NULL
tstate<br><br><br>Could you please let me know if you spot any problems in the above code? Or what is it that causes this particular problem in general?<br><br>Thanks a lot in advance,<br>Raj<br><br><div> </div>~Raj<br>http://rajorshi.co.cc<div><br></div></div><br>
</body></html>