Fast text display?



As a hobby project, I'm writing a MUD client -- this scratches an itch, and is also a good excuse to become familiar with the Python language. I have a conceptual handle on most of the implementation, but the biggest unknown for me is the seemingly trivial matter of text display.

My first requirement is raw speed; none of what I'm doing is processing-intensive, so Python itself shouldn't be a problem here. But still, it's highly desirable to have very fast text updates (text inserted only at the end)-- any slower than 20ms/line stretches usability for fast-scrolling. EVERY other action on the text display, though, like scrolling backwards or text selection, can be orders of magnitude slower.

The second requirement is that it support text coloration. The exact markup method isn't important, just so long as individual characters can be independently colored.

The third requirement is cross-platform-osity; if you won't hold it against me I'll tell you that I'm developing under Cygwin in Win2k, but I'd really like it if the app could run under 'nix and mac-osx also.

I'm pretty open to any graphical toolkit -- I have experience with none of them, so I have little in the way of prejudice.

I'm not even sure where to start looking to see if a widget that does this has been premade -- the text widgets that I've seen so far have all had documentation geared more towards text editing than pure display. My closest look has been at PyGTK -- the GTK text widget is certainly complex enough to handle the markup, but it also seems a little bit feature-rich for my needs so I'm concerned about the overhead.

In a worst-case scenario, I could try writing a widget-lite with SDL or possibly an OpenGL texture, but if a widget somewhere will already do this then it'd be needless work. To boot, I have no idea how to handle selection on such a homebrew-display if I'm using a proportional font, but that's a minor matter.

So, the one-line summation of the novel above, does any one know of a gui toolkit/widget that will do (preferably extremely) fast text display in a cross-platform manner?

PS: I couldn't get a prototype curses display working either, the scroll() function didn't work -- interactive log below:
>>> import curses
>>> x = curses.initscr()
>>> print curses.has_il()
True
>>> x.idlok(1)
>>> x.scroll(1)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
_curses.error: scroll() returned ERR
.




Relevant Pages

  • time module question
    ... How would one go about writing a program which included a clock that ... Right now I'm able to display the time in a text widget in ...
    (comp.lang.python)
  • Re: C vs Tcl again...
    ... display the canvas widget is definitely fast ... you mentioned that you may want to display millions ... The beauty is that a 'custom' widget in another language can be called ...
    (comp.lang.tcl)
  • Re: Applying text tags to open channel
    ... to improve the display by adding coloring to specific terms. ... I'm having some difficulty with tags in the text widget. ... My strategy is to regsub the specific term with the term + the tag ... regsub html $data [list html htmltag] ...
    (comp.lang.tcl)
  • Re: Term for kana subtext on kanji?
    ... >> I think, usually, Japanese reader program can display vertical ... >> Japanese novel books should be read. ... >> editors don't support vertical writing while they bothered to ... >> care to support stupid things like Unicode. ...
    (sci.lang.japan)
  • Applying text tags to open channel
    ... to improve the display by adding coloring to specific terms. ... I'm having some difficulty with tags in the text widget. ... My strategy is to regsub the specific term with the term + the tag ... regsub html $data [list html htmltag] ...
    (comp.lang.tcl)