11 January 2018

Set Window Icon in Python Gui Programing

import sys
from PyQt4 import QtGui

class Example(QtGui.QWidget):
   
    def __init__(self):
       super(Example,self).__init__()
       self.initUi()

    def initUi(self):
       self.setGeometry(10,10,300,300)
       self.setWindowTitle('Windo ICON')
       self.setWindowIcon(QtGui.QIcon('icon.png'))
       self.show()



def main():
    app = QtGui.QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())


if __name__ == '__main__':
    main()

No comments:

Post a Comment

UVA 10679 - I Love Strings!!