In my GUI I have a for-statement that opens a text file and changes the color 
of a QFrame depending on the first letter of each line in the file.  The 
relevent part of the code is attached as a text file, and so is the sample text 
file I've been using.

The raw_input lines were added so I could pause it and see when the color 
changes.  I expected it to change color when I had to raw_input, but instead it 
waits until the line of the text file to change color.  How do I make the 
QFrames change color as it goes through the file?

Thank you,
David
            infile = open("initialize_processor.txt")
            for line in infile:
                if line.startswith("P") == True:
                    
self.QFrame1.setStyleSheet(QApplication.translate("MainWindow", 
"background-color: rgb(102,255,102);", None, QApplication.UnicodeUTF8))
                    raw_input("P")
                if line.startswith("R") == True or line.startswith("I") == True:
                    
self.QFrame2.setStyleSheet(QApplication.translate("MainWindow", 
"background-color: rgb(102,255,102);", None, QApplication.UnicodeUTF8))
                    raw_input("R or I")
P 1
P 2
I 3
D 4
I 5
R 6
R 7
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to