summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorErik Rose <erik@mozilla.com>2011-11-30 23:42:49 -0800
committerErik Rose <erik@mozilla.com>2011-11-30 23:42:49 -0800
commit3c711a9ce95856239a451f6c8dae2a2865979ffc (patch)
tree71240809bac2ab0bffbecdbcc559f9bedcaa62c8 /README.rst
parent9647da944a5f17e5b46ef9ad86830e8bdd47968c (diff)
downloadblessings-3c711a9ce95856239a451f6c8dae2a2865979ffc.tar.gz
I've been using `height` wrong this whole time. It's 1-based.
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index 3840cda..55f91ec 100644
--- a/README.rst
+++ b/README.rst
@@ -50,7 +50,7 @@ of the screen::
if cup:
# tigetnum('lines') doesn't always update promptly, hence this:
height = struct.unpack('hhhh', ioctl(0, TIOCGWINSZ, '\000' * 8))[0]
- print tparm(cup, height, 0) # Move cursor to bottom.
+ print tparm(cup, height - 1, 0) # Move cursor to bottom.
print 'This is {under}underlined{normal}!'.format(under=underline,
normal=normal)
print rc # Restore cursor position.
@@ -61,7 +61,7 @@ this time with Blessings::
from blessings import Terminal
term = Terminal()
- with term.location(0, term.height):
+ with term.location(0, term.height - 1):
print 'This is', term.underline('pretty!')
It's short, it's obvious, and it keeps all those nasty ``tigetstr()`` and
@@ -254,7 +254,7 @@ return: for example, when updating a progress bar at the bottom of the screen.
from blessings import Terminal
term = Terminal()
- with term.location(0, term.height):
+ with term.location(0, term.height - 1):
print 'Here is the bottom.'
print 'This is back where I came from.'
@@ -287,7 +287,7 @@ apparently headed into a pipe::
term = Terminal()
if term.is_a_tty:
- with term.location(0, term.height):
+ with term.location(0, term.height - 1):
print 'Progress: [=======> ]'
print term.bold('Important stuff')