enable/disable widgets with checkbox(TKinter)

Discussion in 'Python' started by jwsacksteder@ramprecision.com, Nov 4, 2003.

  1. Guest

    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,parent=None):
    Frame.__init__(self,parent)
    self.CheckMode = IntVar()

    self.mode_label = Label(self, text='All Line Items?',
    borderwidth='5')
    self.mode_box = Checkbutton(self,
    width='1',variable=self.CheckMode,command=self.FlipState)
    self.input_label = 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.LineItemMode.get()
     
    , Nov 4, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick
    Replies:
    1
    Views:
    949
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,584
    ThunderMusic
    Jan 25, 2006
  3. =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=

    Placing entry widgets on a canvas in Tkinter

    =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=, Jun 30, 2003, in forum: Python
    Replies:
    0
    Views:
    599
    =?ISO-8859-1?Q?Mickel_Gr=F6nroos?=
    Jun 30, 2003
  4. Marcus Schneider

    Modifying TKinter widgets defined in Modules

    Marcus Schneider, Aug 15, 2003, in forum: Python
    Replies:
    2
    Views:
    521
    Marcus Schneider
    Aug 16, 2003
  5. Dean

    XP styled Tkinter widgets

    Dean, Oct 20, 2003, in forum: Python
    Replies:
    1
    Views:
    483
    Jeff Hobbs
    Oct 20, 2003
  6. John
    Replies:
    7
    Views:
    354
    Richard Cornford
    Sep 11, 2005
  7. bigrich
    Replies:
    2
    Views:
    358
    Sean Berry
    Jan 18, 2006
  8. Kevin
    Replies:
    2
    Views:
    381
Loading...