npyscreen

How do I make an exit button in npyscreen?

江枫思渺然 提交于 2020-12-05 22:17:41
问题 What I want is basically a regular npyscreen.Form, but I want the "OK" button to say "Exit". It appears that you can't change the name of the button in the regular npyscreen.Form, so I tried subclassing npyscreen.ButtonPress: import npyscreen class ExitButton(npyscreen.ButtonPress): def whenPressed(self): self.parentApp.setNextForm(None) class MainForm(npyscreen.FormBaseNew): def create(self): self.exitButton = self.add(ExitButton, name="Exit", relx=-12, rely=-3) class App(npyscreen

How do I make an exit button in npyscreen?

懵懂的女人 提交于 2020-12-05 21:59:17
问题 What I want is basically a regular npyscreen.Form, but I want the "OK" button to say "Exit". It appears that you can't change the name of the button in the regular npyscreen.Form, so I tried subclassing npyscreen.ButtonPress: import npyscreen class ExitButton(npyscreen.ButtonPress): def whenPressed(self): self.parentApp.setNextForm(None) class MainForm(npyscreen.FormBaseNew): def create(self): self.exitButton = self.add(ExitButton, name="Exit", relx=-12, rely=-3) class App(npyscreen

How do I make an exit button in npyscreen?

你离开我真会死。 提交于 2020-12-05 21:58:44
问题 What I want is basically a regular npyscreen.Form, but I want the "OK" button to say "Exit". It appears that you can't change the name of the button in the regular npyscreen.Form, so I tried subclassing npyscreen.ButtonPress: import npyscreen class ExitButton(npyscreen.ButtonPress): def whenPressed(self): self.parentApp.setNextForm(None) class MainForm(npyscreen.FormBaseNew): def create(self): self.exitButton = self.add(ExitButton, name="Exit", relx=-12, rely=-3) class App(npyscreen

How do you combine multiple TUI forms to write more complex applications?

落爺英雄遲暮 提交于 2019-12-09 12:56:02
问题 I would like to write a program with a T ext-based U ser I nterface (TUI) that consists of several forms. The first form contains a "list". Each list element represents a button. If the respective button is pressed, another form should appear in which one can enter the data for the list entry. Then the first form is displayed again (with updated list entries). Here is my attempt, which uses the library npyscreen but does not return to the first form. The code does also not contain the logic