473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

gtk.Entry Colors

I would like to manipulate PyGTK Entry widget's background and
foreground colors. Is it possible? How?

Tuomas
Sep 24 '06 #1
4 9093
Tuomas wrote:
I would like to manipulate PyGTK Entry widget's background and
foreground colors. Is it possible? How?
Yes, it is possible:

# widget color
entry.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("#FF0000"))
# frame color
entry.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#0000FF"))
# text color
entry.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("#00FF00"))

See:
http://www.pygtk.org/pygtk2reference...gtkwidget.html
http://www.pygtk.org/pygtk2reference...-gdkcolor.html

Regards,
Jordan

Sep 24 '06 #2
MonkeeSage wrote:
Tuomas wrote:
>>I would like to manipulate PyGTK Entry widget's background and
foreground colors. Is it possible? How?


Yes, it is possible:

# widget color
entry.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("#FF0000"))
# frame color
entry.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#0000FF"))
# text color
entry.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("#00FF00"))

Thanks a lot.
See:
http://www.pygtk.org/pygtk2reference...gtkwidget.html
http://www.pygtk.org/pygtk2reference...-gdkcolor.html
Yes, I read the reference before posting here. I tried something like:

attr_list=pango.AttrList()
attr=pango.AttrForeground(0, 0, 65000, start_index=0, end_index=-1)
attr_list.insert(attr)
entry.get_layout().set_attributes(attr_list)

or

entry.window.set_background(gtk.gdk.color_parse("# 0000FF"))

but they did not work for this purpose.

Tuomas
Regards,
Jordan
Sep 25 '06 #3
Tuomas wrote:
Yes, I read the reference before posting here. I tried something like:
Hi Tuomas,

I didn't mean to say that you hadn't read the docs (I had a hard time
finding the right methods in the docs too, even though I know the
methods); I just wanted to give you the references so you could see the
method signatures and the other gdk.Color options. :)

Regards,
Jordan

Sep 25 '06 #4
MonkeeSage wrote:
Tuomas wrote:
>>Yes, I read the reference before posting here. I tried something like:


Hi Tuomas,

I didn't mean to say that you hadn't read the docs (I had a hard time
finding the right methods in the docs too, even though I know the
methods); I just wanted to give you the references so you could see the
method signatures and the other gdk.Color options. :)

I didn't meant to blame you of blaming me either. I had worked with this
problem a couple of days and your advice helped me to solve it in ten
minutes. So I am very grateful.

Nice thing this Python :)

Tuomas
Regards,
Jordan
Sep 25 '06 #5

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

Similar topics

5
by: aznFETISH | last post by:
I have a list of links that I ue on my page, I alternate background colors for these links in a table, I usually do it using a DB but this list of link is manually added into the page so my...
5
by: Dan Jacobson | last post by:
What's Nielsen talking about in http://www.useit.com/alertbox/20040503.html http://www.useit.com/alertbox/20040510.html Can't a good browser keep track of visited vs. unvisited link colors? Is my...
3
by: Marc | last post by:
Hi, maybe you guys know something I don't know... Is it possible (and how) to achieve the following: 1) A <BODY> with specific background-color, say blue. 2) A <DIV class='main'> (which...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
6
by: Mark | last post by:
Is there a programatic way to iterate through all the named colors? Something like: HtmlTable ht = new HtmlTable(); HtmlTableRow htr; HtmlTableCell htc; foreach (Color c in ) //I CAN'T FIND...
11
by: Paul Smith | last post by:
I have a button on my web page the backcolor of which I want to change: btnSample.backcolor = ???????? I want the color to be Gainsboro However I enter Gainsboro or color.Gainsboro I have...
4
by: NewAlias | last post by:
How to display comments for each enum entry? 'Enum example with commnents commented Private Enum MyEnum YourName =1 ' Set this to get your real name YourAge=2 ' Set this to get your real age...
5
by: Steve B. | last post by:
Without adding whitespace to the ComboBox datasource is there a way I can add a blank entry or, a reset entry, to the ComboBox dropdown Thanks Steve
1
by: Demi | last post by:
I want to be able to define standard colors in a base form, then have child forms use those values instead of standard colors. Ex in my base form I want to do this: Color myColor =...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.