[pygtk] Setting the Colors in a ZVTerm
Eric Gillespie, Jr.
epg@progeny.com
23 Oct 2000 12:29:11 -0500
I'm trying to set the colors of a ZVTerm to white on black. I
copied the color codes from gnome-terminal.c, but i must be doing
something wrong in passing them to set_color_scheme(). I've tried
2 different methods (one is commented out), and neither worked.
What am i doing wrong?
The colors list was generated by having Python print the red,
green, and blue lists and then copying them into the file. I
thought that the hex might be throwing it off somehow.
Thanks in advance.
from gnome.zvt import *
from gtk import *
red = [0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
0x0000, 0xaaaa, 0x5555, 0xffff, 0x5555, 0xffff,
0x5555, 0xffff, 0x5555, 0xffff, 0xaaaa, 0x0]
green = [0x0000, 0x0000, 0xaaaa, 0x5555, 0x0000, 0x0000,
0xaaaa, 0xaaaa, 0x5555, 0x5555, 0xffff, 0xffff,
0x5555, 0x5555, 0xffff, 0xffff, 0xaaaa, 0x0]
blue = [0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa,
0xaaaa, 0xaaaa, 0x5555, 0x5555, 0x5555, 0x5555,
0xffff, 0xffff, 0xffff, 0xffff, 0xaaaa, 0x0]
colors = [ (0, 0, 0),
(43690, 0, 0),
(0, 43690, 0),
(43690, 21845, 0),
(0, 0, 43690),
(43690, 0, 43690),
(0, 43690, 43690),
(43690, 43690, 43690),
(21845, 21845, 21845),
(65535, 21845, 21845),
(21845, 65535, 21845),
(65535, 65535, 21845),
(21845, 21845, 65535),
(65535, 21845, 65535),
(21845, 65535, 65535),
(65535, 65535, 65535),
(43690, 43690, 43690),
(0, 0, 0)
]
#colors = []
#for i in range(len(red)):
# colors.append((red[i], green[i], blue[i]))
win = GtkWindow(WINDOW_DIALOG)
term = ZvtTerm(80, 25)
term.set_color_scheme(colors)
term.show()
win.add(term)
win.show()
mainloop()
--
Eric Gillespie, Jr. <*> epg@progeny.com
Software Developer
Progeny Linux Systems - http://progeny.com