Curses - How to insert predefined name of INPUT items? -


how please insert predefined name of input items ?

my efforts: (info: character "_" cursor)

def edit_item(stdscr, item_name)     stdscr.addstr(1, 2, "item name:")     r = stdscr.getstr(2, 16, 15)     return r  edit_item(stdscr, 'foo') edit_item(stdscr, 'bar') 

result:

item name: _ item name: _ 

the desired result:

item name: foo_ item name: bar_ 

thank help.

@thomas dickey: no :-( try better describe need..

- call function 'edit_item' parameter 'foo'           # ok - screen prints 'item name: foo'                       # ok - cursor behind word 'foo_'                     # ok - press key arrow left (2x) change cursor 'f_o' # not work - edit word 'foo' 'fao' 

it's understand?

# # # # # # # # # # # # # # # # #

this need in curses.

demonstration in bash

read -e -i "foo" -p "edit item name: " item 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -