Questions tagged [npyscreen]

Npyscreen is a python widget library and application framework for programming terminal or console applications. It is built on top of `ncurses`, which is part of the standard library.

Npyscreen is a python widget library and application framework for programming terminal or console applications. It is built on top of ncurses, which is part of the standard library.

Homepage: http://npyscreen.readthedocs.io

30 questions
5
votes
0 answers

How should widgets be resized in npyscreen (a Python curses wrapper)?

I want the height of some widgets in my npyscreen app to resize as the terminal is resized. Specifically I want those two column widgets to continue to take up about the same fraction of the height of the terminal when the terminal is resized, with…
BlandCorporation
  • 1,324
  • 1
  • 15
  • 33
5
votes
2 answers

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

I would like to write a program with a Text-based User Interface (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…
AFoeee
  • 731
  • 7
  • 24
3
votes
1 answer

Does npyscreen support clickable grid rows?

npyscreen lets you create a grid, and even set select_whole_line=True so that an entire line is selected when you move through the grid with your arrow keys. Is it possible to do something when the user picks a row in the grid and hits enter?
John
  • 2,551
  • 3
  • 30
  • 55
3
votes
4 answers

How do I make an exit button in npyscreen?

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…
John
  • 2,551
  • 3
  • 30
  • 55
2
votes
1 answer

Is it possible to make a custom handler for the enter key in a npyscreen Textfield?

I'm trying to build a chat application with npyscreen in Python. When enter is hit on the Textfield widget, nothing happens. I'd like to make this action send the message to the server. I've already made it working by using a MultiLineEdit widget…
Jurze
  • 209
  • 2
  • 11
2
votes
1 answer

How do you test your ncurses app in Python?

We've built cli-app with Python. Some part need ncurses, so we use npyscreen. We've successfully tested most part of app using pytest (with the help of mock and other things). But we stuck in 'how to test the part of ncurses code' Take this part of…
azzamsa
  • 1,805
  • 2
  • 20
  • 28
2
votes
1 answer

multi forms in one frame npyscreen

Hello I have started learning npyscreen for tui and I have searched the internet for `multi forms in one frame for npyscreen cant find an answer im trying to make apps that look like this
dsal3389
  • 658
  • 1
  • 7
  • 26
1
vote
1 answer

How to switch the currently displayed Form using npyscreen

I am building a simple application using npyscreen to build fancy menus. As the documentation says, I use the switchForm() method retrieved by self.parentApp to change the currently displayed form. However, when called in splash.show_splash()…
D D
  • 37
  • 3
1
vote
0 answers

Issue switching between forms in NPSAppManaged Application

I have been trying to create an application with npyscreen for a couple weeks now, but I keep running into hangups. I can switch from my main form to a second form. But when I try to switch back to the main form the application does literally…
Masterisk
  • 21
  • 3
1
vote
1 answer

module 'npyscreen' has no attribute 'wrapper_basic'

When I try to use a function of the npyscreen module it returns the error that the attribute can not be found. I do not understand why. Does anyone have an idea what is going wrong? import npyscreen def simple_function(*args): …
SirMario
  • 31
  • 3
0
votes
0 answers

How to make an npyscreen widget that only accepts numbers

I am using the latest version of npyscreen. I want to make a Text widget that only supports numbers, it should do nothing when any other character is inserted, not display it or save it. Preferably, I want it to display it in a set format like…
Rein F
  • 320
  • 3
  • 9
0
votes
1 answer

display content in npyscreen

I start to play around with npyscreen. I want the output of def ping() displayed within a box in npyscreen. At this moment I have the following code: #!/usr/bin/env python # encoding: utf-8 import sys import curses import npyscreen import…
0x01_PH
  • 126
  • 10
0
votes
0 answers

Issue with displaying calendar within a form using npyscreen

I am trying to create a tool in Python that allows the user to select a date or a range of dates through a calendar within a form using npyscreen. The calendar should allow the user to select the month and year within a range of dates from November…
bonzix
  • 45
  • 5
0
votes
0 answers

Create a folder selection menu in npyscreen

I'm working on a npyscreen interface and want a popup with a folderselection, but I don't know how to do it. I have a working basic Interface and within menu are 2 Options ("C1" and "C2"). For example: Select C1 -> hit enter -> Popup appears and let…
0x01_PH
  • 126
  • 10
0
votes
1 answer

curses.KEY_UP and curses.KEY_DOWN don't work when using npyscreen

I want to use curses.KEY_UP and curses.KEY_DOWN to increment and decrement the index using the functions I created. My handlers can use any key but it doesn't seem to be working when using the up and down key. import npyscreen, curses index =…
Mark
  • 117
  • 2
  • 9
1
2