import sys
from PyQt4 import QtGui, QtCore # to help add buttons
#app = QtGui.QApplication(sys.argv)
#
#window = QtGui.QWidget()
#
##set the posstion and size of the window
#window.setGeometry(50, 50, 500, 500)
#
##lets set the title
#window.setWindowTitle('Date Incrementor')
#window.show()
class Window(QtGui.QMainWindow):
def __init__(self):
super(Window, self).__init__()
self.setGeometry(50,50, 500, 500)
self.setWindowTitle("Date incrementor")
# self.setWindowIcon(QtGui.QIcon('logo.png'))
#self.show()
self.home()
def home(self):
#create and name a button
btn = QtGui.QPushButton("Quit", self)
#define what we will do when the button is clicked
#btn.clicked.connect(QtCore.QCoreApplication.instance().quit)
btn.clicked.connect(self.closeapplication)
#lets resisze the button
btn.resize(100,100)
#lets position the button
btn.move(100,100)
#lets show the button
self.show()
#lets create custom methods
def closeapplication(self):
print('Application closed')
sys.exit()