Example #1
0
def test_1():
    stdscr = curses.initscr()
    
    #curses.noecho()
    #curses.echo()
    
    begin_x = 20
    begin_y = 7
    height = 5
    width = 40
    win = curses.newwin(height, width, begin_y, begin_x)
    tb = curses.textpad.Textbox(win)
    text = tb.edit()
    curses.addstr(4,1,text.encode('utf_8'))
    
    hw = "Hello world!"
    while 1:
        c = stdscr.getch()
        if c == ord('p'):
            break # Exit the while()
        elif c == ord('q'):
            break # Exit the while()
        elif c == curses.KEY_HOME:
            x = y = 0
    
    curses.endwin()
Example #2
0
def a_textbox():
    begin_x = 20
    begin_y = 7
    height = 5
    width = 40
    win = curses.newwin(height, width, begin_y, begin_x)
    tb = curses.textpad.Textbox(win)
    text = tb.edit()
    curses.addstr(4, 1, text.encode('utf_8'))
Example #3
0
 def main(stdscr):
     begin_x = 20
     begin_y = 7
     height = 5
     width = 40
     win = curses.newwin(height, width, begin_y, begin_x)
     tb = curses.textpad.Textbox(win)
     text = tb.edit()
     curses.addstr(4, 1, text.encode('utf_8'))
     time.sleep(10)
Example #4
0
def colors(stdscr):
    colors = {getattr(curses, name): name for name in dir(curses) if
        name.startswith("COLOR_")}

    if not curses.can_change_color():
        curses.addstr("Sorry, your terminal doesn't support color awesomeness")
        stdscr.refresh()
        get_q()
        return



    stdscr.refresh()
Example #5
0
def google():
    begin_x = 20
    begin_y = 7
    height = 5
    width = 40
    curses.noecho()
    curses.cbreak()
    win = curses.newwin(height, width, begin_y, begin_x)
    try:
        tb = curses.textpad.Textbox(win)
        text = tb.edit()
        curses.addstr(4,1,text.encode('utf_8'))
    finally:
        curses.endwin()
Example #6
0
#!/usr/bin/env python2

import curses
import curses.textpad
import time

stdscr = curses.initscr()

#curses.noecho()
#curses.echo()

begin_x = 20
begin_y = 7
height = 5
width = 40
win = curses.newwin(height, width, begin_y, begin_x)
tb = curses.textpad.Textbox(win)
text = tb.edit()
curses.addstr(4, 1, text.encode('utf_8'))

#hw = "Hello world!"
#while 1:
# c = stdscr.getch()
# if c == ord('p'):
# elif c == ord('q'): break # Exit the while()
# elif c == curses.KEY_HOME: x = y = 0

curses.endwin()
Example #7
0
#!/usr/bin/env python2

import curses
import curses.textpad
import time

stdscr = curses.initscr()

#curses.noecho()
#curses.echo()

begin_x = 20
begin_y = 7
height = 5
width = 40
win = curses.newwin(height, width, begin_y, begin_x)
tb = curses.textpad.Textbox(win)
text = tb.edit()
curses.addstr(4,1,text.encode('utf_8'))

#hw = "Hello world!"
#while 1:
# c = stdscr.getch()
# if c == ord('p'):
# elif c == ord('q'): break # Exit the while()
# elif c == curses.KEY_HOME: x = y = 0

curses.endwin()
Example #8
0
import curses.textpad
import time

stdscr = curses.initscr()

curses.noecho()
#curses.echo()

begin_x = 20
begin_y = 7

height = 5
width = 40

win = curses.newwin(height, width, begin_y, begin_x)
tb = curses.textpad.Textbox(win)
text = tb.edit()
curses.addstr(0, 0, text)

# hw = "Hello world!"
# while 1:
#    c = stdscr.getch()
#    if c == ord('p'):
#        pass
#    elif c == ord('q'):
#        break # Exit the while()
#    elif c == curses.KEY_HOME:
#         x = y = 0

curses.endwin()
Example #9
0
 def local_print(string):
     if curses:
         curses.addstr(string)
     else:
         print(string, end='')