import npyscreen import sys class QuitButton(npyscreen.ButtonPress): def whenPressed(self): sys.exit(0) class SendButton(npyscreen.ButtonPress): def whenPressed(self): self.parent.parentApp.switchForm('GAME') class GameNavigator(npyscreen.FormBaseNew): # def afterEditing(self): #it self.parentApp.setNextForm('GAME') def create(self): top_division_height = 20 inventory_width = 20 art_width = 100 self.artBox = self.add(npyscreen.BoxBasic, name='ArtBox', max_width=art_width, max_height=top_division_height, rely=2, relx=inventory_width + 1, editable=False) self.artContent = self.add(npyscreen.MultiLineEdit, rely=3, relx=inventory_width + 2, max_width=art_width - 2, max_height=top_division_height - 2, value=self.parentApp.gamelib['menu']['graphics']['not_found'], editable=False) self.artBox.footer = 'Unknown Location' self.artBox = self.add(npyscreen.BoxBasic, name='Inventory', max_width=inventory_width, max_height=top_division_height, relx=1, rely=2, editable=False) self.dialogueBoxOutline = self.add(npyscreen.BoxBasic, max_width=inventory_width + art_width, max_height=3, relx=1, rely=top_division_height + 2, editable=False) self.dialogueBox = self.add(npyscreen.Textfield, name='Type Here', max_width=inventory_width + art_width - 7, max_height=1, relx=2, rely=top_division_height + 3) self.sendButton = self.add(SendButton, name="Send", relx=inventory_width + art_width - 7, rely=top_division_height + 3) self.quitButton = self.add(QuitButton, name="Quit", relx=1, rely=1)