tests/curses_unicode.py
author Radek Brich <radek.brich@devl.cz>
Mon, 10 Oct 2011 22:20:59 +0200
changeset 25 f69a1f0382ce
parent 20 472a753664f9
child 110 cf3d49cdd6e2
permissions -rwxr-xr-x
Partial DriverPygame.putch() implementation. Add patch for PyGame implementing font.render_glyph(). Add test for PyGame font module. Add special key definitions to DriverPygame.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     1
#!/usr/bin/python
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
# coding=UTF-8
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     4
import curses
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
import locale
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     6
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
locale.setlocale(locale.LC_ALL, "")
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     9
def doStuff(stdscr):
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
  message = "Žlutý kůň.\nPress 'q' to quit.\n"
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
  stdscr.addstr(0, 0, message, 0)
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    12
  while True:
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
    c = stdscr.getch() # pauses until a key's hit
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
    if c == ord('q'):
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    15
      break
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    16
    stdscr.addch(c)
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    17
5e78d52ebb24 Update demos and tests.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    18
curses.wrapper(doStuff)