J
jeff
I looked around a lot on the internet and couldn't find out how to do
this, how do I get the sizer (in rows and columns) of the view?
this, how do I get the sizer (in rows and columns) of the view?
I looked around a lot on the internet and couldn't find out how to do
this, how do I get the sizer (in rows and columns) of the view?
You use the TIOCGWINSZ ioctl() call on the tty device in question.
import termios, fcntl, struct, sys
s = struct.pack("HHHH", 0, 0, 0, 0)
fd_stdout = sys.stdout.fileno()
x = fcntl.ioctl(fd_stdout, termios.TIOCGWINSZ, s)
print '(rows, cols, x pixels, y pixels) =',
print struct.unpack("HHHH", x)
jeff said:I don't really understand any of that; can you right me a function
that'll return the size as a tuple?
I don't really understand any of that; can you right me a function
that'll return the size as a tuple?
What do you think I posted?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.