473,503 Members | 10,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GdkColor : the phantom class ?

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 ...

Apr 14 '06 #1
1 1487
I found an answer :

color = gtk.gdk.Color()

and then use color for fg et bg

Apr 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2607
by: Andrew | last post by:
Hi All, Have come across something weird and am after some help. Say i run this query where rec_id is a column of table arlhrl, select * from arlhrl where rec_id >= 14260 This returns to...
2
2041
by: Lars Eighner | last post by:
I am trying to force my pages into the skidoo_two three-column layout. Evidently I am breaking some of the hacks as I do so. In Opera 7.54 (FreeBSD) I see phantom underlines, starting about...
0
1258
by: omyek | last post by:
I'm essentially trying to do what a lot of users seem to want when using the above classes, and that's POST to a webpage. Well, I'm golden when it comes to POSTing, I've been able to post to...
3
2343
by: memememe | last post by:
I see weak reference on the .net api, but I do not see soft or phantom, are they supported on .net?
0
1228
by: Rod Billett | last post by:
The included html contains 3 divs. One primary Div, with 2 nested divs. the second nested DIV contains an empty table. Problem 1: Phantom Space. When viewed within the browser, the div 'action...
0
1228
by: MIGUEL | last post by:
Hi all! Be patient because what I'm going to explain all of you it's more than very strange. I've developed a webservice project that contains two classes. One of them is going to act as a...
9
1260
by: Dave | last post by:
Apologies if this has come up before, but I can't find it if it has. I am fairly new to .Net and am having problems with ghosts in the datagrid. Basically I have a find screen that accepts...
1
886
by: Frank | last post by:
I'm a little confused as to why an old base class for my derived class is still showing up in the Local / Watch window. Basically I have removed all association with that old base class -...
9
1584
by: TB | last post by:
Hi all: I realize that this is strictly speaking not an ASP.NET question, but since most of you people out there SQL gurus as well, I hope you will bear with me on this occasion: I would like...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.