473,666 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Background/foreground on disabled Tkinter.Entry

If I create a Tkinter.Entry widget, I can adjust the background and the
text colours, using the background and foreground options. However, if
the state is "disabled", then this has no effect and it just appears as
grey on a light grey background. E.g.,

Tkinter.Entry(r oot, foreground="bla ck", background="whi te",
state="disabled ").grid()

does not do what I expected. What is the correct way to adjust the
foreground and background on disabled Entry widgets?

Thanks,

Martyn

Jan 22 '06 #1
2 14102
Martyn Quick wrote:
If I create a Tkinter.Entry widget, I can adjust the background and the
text colours, using the background and foreground options. However, if
the state is "disabled", then this has no effect and it just appears as
grey on a light grey background. E.g.,

Tkinter.Entry(r oot, foreground="bla ck", background="whi te",
state="disabled ").grid()

does not do what I expected. What is the correct way to adjust the
foreground and background on disabled Entry widgets?


tkinter has separate disabledbackgro und and disableforegrou nd options for
this purpose:

http://www.effbot.org/tkinterbook/en....config-method

</F>

Jan 22 '06 #2
Thanks v. much.
I'd missed that in the documentation I have access to.

Martyn

Jan 22 '06 #3

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

Similar topics

0
3594
by: wang xiaoyu | last post by:
Hello,everyone. my program runs well in windows,i use tkSimpleDialog to receive some input,but when i copy my program into Linux RH8.0,entrys in my tkSimpleDialog derived Dialog have a vital problem:only one entry can receive key event,'tab' key to navigate between entrys is not valid too,when i use mouse to focus a entry(which can not navigate through 'tag' key),no matter what key i pressed the entry receive no reply.But in window they...
3
4926
by: Phil Schmidt | last post by:
I'm trying to make a custom entry widget, as in the code that follows. There are two problems I'm trying to fix: 1) I would like the widget to behave as myEntry.Escape() does now, except that it happens on loss of focus, not when pressing Esc. 2) TABbing between multiple entry fields does undesired things with the selection, and with cursor placement. Can anyone offer any suggestions for how to fix this? I'm attemting to
5
10905
by: Otto Krüse | last post by:
Hi everyone, I'm building a GUI in which I want, amongst other things, for people to fill in there postal code. The postal codes of my country (Holland) are in this format: 1234 AB So for the input I use two entry widgets, one of a length of (characters) for the numbers and one of lenght 2 for the letters. What I don't like is that although the visible part of the widgets thus are 4 and 2 characters, users can actually input more...
1
1534
by: phil | last post by:
In a Tkinter entry field (or Pmw entry) how could I eat charactres? Say a certain char is keyed in. Say & I notice in the event handler for <key>. I don't want any more charactres to display or be in the field until I handle a see, in the event handler, another character. Say ? Can the event handler somehow destroy the char?
2
1926
by: Ian Vincent | last post by:
I am hoping someone may be able to help. I am using Python and TKinter to create a GUI program that will eventually create an XML file for a project I am working on. Now, the XML file contents changes depending on the type of file it represents - so I am dynamically creating the TK Entry boxes. The problem is, I want the variable assigned to each of these boxes to be dynamically assigned as well but I cannot see how to do this (if it is...
3
3360
by: Brian Mitchell | last post by:
Is it possible to change the fore and back colors of a combo box when its enabled property is set to false? I need to lock the value of my combo boxes (and still keep its color) but that control doesn't have a read-only property. Thanks!!
3
1902
Elias Alhanatis
by: Elias Alhanatis | last post by:
Hello to everybody!! I am running Python 2.5.1 on Windows Vista and i have a problem with the "Entry" widget of Tkinter. Take a look at this code: from Tkinter import * def fetch(): q=(e.get()) print q
2
1907
Strider1066
by: Strider1066 | last post by:
Is it a bug or a feature? I'm trying to sub-class an Entry widget that displays a template (i.e. '____-__-__') for users and does keystroke validation. It is starting to work but with one problem. Every key is echoed in the Entry widget. If I were to type a '2', '22__-__-__' is displayed. The next entry replaces the first duplicate with another, that is if I were to then type a '3' the display now shows '233__-__-__', and so on. The correct...
0
1499
by: Leonhard Vogt | last post by:
Hello I have the following problem in Python 2.5 on Windows XP. On Ubuntu I do not see the problem. I have a Tkinter application as in the following example The entry-widget is somehow blocked (i cannot type characters into it) when I call askopenfilename before I create the widget. Calling askopenfile again (by clicking the button) releases the block, I can type into the entry as expected.
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8783
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2773
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 we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.