GUI Prototyping

This commit is contained in:
harmacist 2021-03-27 14:13:09 -05:00
parent ba54082b60
commit 68e9f57d22

View File

@ -1,15 +1,20 @@
import sys import sys
from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton
from PyQt5.Qt import QStandardItemModel, QStandardItem
from PyQt5.QtGui import QIcon from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
import json
import GlowstoneDust
class App(QWidget): class App(QMainWindow):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.title = 'Project Glowstone: Block Edition' self.title = 'Project Glowstone: Block Edition'
self.left = 10 self.left = 300
self.top = 10 self.top = 300
self.width = 640 self.width = 640
self.height = 480 self.height = 480
self.initUI() self.initUI()
@ -17,8 +22,26 @@ class App(QWidget):
def initUI(self): def initUI(self):
self.setWindowTitle(self.title) self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height) self.setGeometry(self.left, self.top, self.width, self.height)
button = QPushButton('Button Label Go Here', self)
button.setToolTip('Example Button')
button.setGeometry(100, 70, 200, 80)
# button.move(100, 70)
button.clicked.connect(self.make_tree)
self.statusBar().showMessage('Message')
self.show() self.show()
@pyqtSlot()
def on_click(self):
print('PyQt5 button click')
@pyqtSlot()
def make_tree(self):
print("Making mod tree...")
modpack_info = GlowstoneDust.get_modpack_info('.')
print(json.dumps(modpack_info))
if __name__ == '__main__': if __name__ == '__main__':
app = QApplication(sys.argv) app = QApplication(sys.argv)