GdkColor : the phantom class ?

T

Thomas Girod

Hi.

No matter how I try, I just can't find this GdkColor class. I'm trying
to convert some data into a pixmap in order to display it. Here is my
code :

import pygtk
pygtk.require('2.0')
import gtk
xbm = """#define dump_width 4
#define dump_height 4
static unsigned char dump_bits[] = { 0xaa, 0x6c, 0x55, 0x58, 0x4f,
0x4d, 0xb, 0x9b, 0xf8, 0xcc, 0x1d, 0xd5, 0x61, 0xa4, 0xd8, 0x78, };"""

class Ex:
def __init__(self):
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.show()

pixmap = gtk.gdk.pixmap_create_from_data(window.window,
##display
xbm, ##data
28,28, ##width/height
8, ##depth
fg,bg)

image = gtk.Image()
image.set_from_pixmap(pixmap, None)
image.show()

def main(self):
gtk.main()
return 0

e = Ex()
e.main()

------
The error comes from fg / bg. It says this have to be of type GdkColor,
but I can't find this class anywhere.

Plus, can anyone explain me the utility of those parameters, as I don't
understand the need to set a background and a foreground when you fill
every damn pixel with data ...
 

Ask a Question

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.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top