Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PyQt4 import QtCore, QtGui, uic
- form_class = uic.loadUiType("main.ui")[0] # Load the UI & class definition for the main window
- b = 0 #values keep track of path
- a = 0
- #text_edit = QPlainTextEdit() #Determine purpose
- class MyWindowClass(QtGui.QMainWindow, form_class):
- def __init__(self, parent=None):
- QtGui.QMainWindow.__init__(self, parent)
- self.setupUi(self)
- self.choicea1.clicked.connect(self.choicea1_clicked) #event handler for button being pushed
- self.choiceb1.clicked.connect(self.choiceb1_clicked)
- self.menuExit.triggered.connect(self.menuExit_selected)
- self.restartBegin.triggered.connect(self.restartBegin_selected)
- #text_edit.setPlainText(text) #Determine purpose
- def menuExit_selected(self):
- self.close()
- def restartBegin_selected(self):
- pass #make it restart somehow
- def choicea1_clicked(self): #defines what happens when the button is pushed
- global a
- a+=1
- mainTextEdit.insertPlainText('a1')
- #x=open('a1.txt', 'r')
- #self.lines = x.readlines()
- #print self.lines
- #text=open('a1.txt').read()
- #text=open('a1.txt').read() #troubleshoot
- #pass #Shift to next part of the story
- def choiceb1_clicked(self):
- global b
- b+=1
- mainTextEdit.insertPlainText('b1')
- #x=open('b1.txt', 'r')
- #self.lines = x.readlines()
- #print self.lines
- #print x
- #pass #Shift to next part of the story
- app = QtGui.QApplication(sys.argv) # PtQt program to show our window
- myWindow = MyWindowClass() # Make an instance of the window class
- myWindow.show() # Start the program and
- app.exec_() # display the GUI window
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement