views:

22

answers:

1

This a screenshot from a Tkinter Listbox in a program I'm writing:

Screenshot of the problem

Why does the \t character show up as a black bar?

On a Mac it shows up normally (as a tab), but on Windows I get this. I think it might have something to do with character encoding because strings are unicode by default in OS X but not Windows?

I tried writing the tab as chr(9) instead of \t, but it didn't help.

A: 

On Windows, the tab character is probably not interpreted by the Listbox rendering code but on Mac, it is. Hence, the difference. But I'm unsure about this since, IIRC, Tkinter uses its own rendering code so it should render the same on all platforms. Maybe this is part of the OS's font rendering code (which is more powerful on the Mac).

It's not a problem of encoding since the tab character is the same on all encodings (well, with the exception of EBCDIC but you're not on a mainframe, so ...)

Aaron Digulla