473,657 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

enable/disable widgets with checkbox(TKinte r)

I want to have a check box that can optionally disable a text input field in
the same dialog. I am asking the user to input the start and end of a range
and there needs to be a check box to select all items. When the checkbox
changes state, I want to ghost-out the input fields.

A rough approximation of the situation follows.

class mystuff(Frame):
def __init__(self,p arent=None):
Frame.__init__( self,parent)
self.CheckMode = IntVar()

self.mode_label = Label(self, text='All Line Items?',
borderwidth='5' )
self.mode_box = Checkbutton(sel f,
width='1',varia ble=self.CheckM ode,command=sel f.FlipState)
self.input_labe l = Label(self, text='Input Name', borderwidth='5' )
self.input_box = Entry(self, width='3')

self.pack()

def FlipState(self) :
#This does not work!
self.input_box. disable()
print "variable is", self.LineItemMo de.get()

Jul 18 '05 #1
0 2263

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

Similar topics

25
3344
by: BJörn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard Python GUI toolkit is that Tkinter was there first." - Guido van Rossum Guess, that answers my question, but isn't "Tkinter was there first" a very bad answer? :) It is kinda ugly too, so I wonder why it can't be replaced? Or maybe another GUI...
5
3688
by: Andrew | last post by:
Hi I was wondering if there is anyway in Tkinter to create GUIs using Graphics, like windows media player or other tools like that basically so the interface wouldn't be your standard interface any ideas, links to tutorials, or examples is appreciated Cheers
2
1731
by: William Gill | last post by:
I need to display a couple of labels and a checkbox from each entry in my database. Simple enough, but there are several hundred records, and I only want to display 5 or 10 at a time. Can this be accomplished by putting everything in a Frame(), using width, height, grid_propagate(0) , and a scrollbar? or do I have to grid 5 rows at a time? If the latter, can I just grid over the previous 5 or do they have to be explicitly removed...
2
1316
by: Michael Yanowitz | last post by:
Hello: I have a Tkinter GUI Dialog with many buttons and labels and text widgets. What I would like to do is, can I: 1) Disable/deactivate/hide a button, text widget that is already drawn (and of course the opposite enable/activate/show it)?
32
7464
by: Kevin Walzer | last post by:
I'm a Tcl/Tk developer who has been working, slowly, at learning Python, in part because Python has better support for certain kinds of applications that I want to develop than Tcl/Tk does. Naturally, I thought that I would use Tkinter as the GUI for these programs. However, in doing research into GUI development techniques, sample code, and showcase applications, what has struck me is how little sophisticated GUI development seems to be...
4
3042
by: peter | last post by:
I've come across a weird difference between the behaviour of the Tkinter checkbox in Windows and Linux. The issue became apparent in some code I wrote to display an image in a fixed size canvas widget. If a checkbox was set then the image should be shrunk as necessary to fit the canvas while if cleared it should appear full size with scrollbars if necessary. The code worked fine under Linux (where it was developed). But under Windows,...
6
3521
by: Gigs_ | last post by:
I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected
1
5106
by: vigacmoe | last post by:
Hi all, I'm trying to write a simple tkinter program, then this problem popped up. The followin code will describe the problem. ------------------------------------------ import Tkinter class countdown(Tkinter.Frame):
0
1798
by: Guilherme Polo | last post by:
On 10/29/08, Olrik Lenstra <o.lenstra@gmail.comwrote: It will be a combination of commands, not a single one. Initially I considered this as "probably without solution", since tcl acquired a yield command just in the 8.6a3 release, but then I looked at wx.SafeYield code and apparently it is possible to replicate it. Here is an initial cut, it is very possible to contain something not equivalent to wx.SafeYield (besides it could be...
0
8385
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
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
8821
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8502
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6162
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
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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
2726
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
1601
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.