Drawing colored text quickly
- From: Chad Robinson <chad whiteaspen com>
- To: gtk-app-devel-list gnome org
- Subject: Drawing colored text quickly
- Date: Mon, 19 Dec 2005 13:55:53 -0500
I have an application that's a rewrite of an old "green screen" terminal
application. It presents columns of data much like a table, but this
information updates VERY rapidly. It's not suitable for display in a table,
because rows will get deleted and added in a hurry (sometimes dozen of updates
per second), and there are a LOT of rows. Tables are even worse because
there's never a need for scrolling, so actually maintaining invisible rows in
a table would be a waste of CPU time.
The old application worked very well via ncurses by drawing strings - its math
on where to put things isn't hard at all. We're just trying to move to a
client/server model, and stay cross-platform. Gtk so far seems the best bet.
So, the question is, how can I quickly draw text in a Gtk application? I see
draw_text and draw_string functions, and they look like exactly what I need.
But, they're deprecated. I see references to Pango here, but can't find a
simple example of what I need to do, and Pango seems horribly obfuscated and
inefficient for this type of activity.
Basically, I need, on demand, to be able to draw text in location X, Y, in
color C, background color B, text T.
It's additionally important to know the available space to draw in. Typically
I'd look to calculate the height of a monospace font, divide that into the
height of the drawing area, and I'd know how many rows to draw. As the user
resizes the window I could intelligently draw additional (or fewer) rows.
What's the easiest and most efficient way to do this in Gtk? I'm at the end of
my rope here, about to switch to something else. I just can't find a clean
option. (FYI, I explored VteTerminal, but which is close but still not great.)
Regards,
Chad
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]