User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 373,930 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,258 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:

Python GUI Problem

Join Date: Nov 2006
Posts: 23
Reputation: Haze is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Haze Haze is offline Offline
Newbie Poster

Re: Python GUI Problem

  #7  
Aug 19th, 2007
Originally Posted by jrcagle View Post
  1. def disable():
  2. root.input_text["state"] = DISABLED
  3.  
  4. root.input_menu.add_radiobutton(label='Input From File', variable = input_option, command = disable)


Ok so i have made a function and changed the command
def disable():
     root.input_text(state = DISABLED) #way you wrote it doesn't work

root.input_menu.add_radiobutton(label='Input From File', variable = input_option, command = disable)

the program loads correctly but as soon as i press that button in the GUI i get this error

File "C:\Python25\lib\lib-tk\Tkinter.py", line 1403, in __call__
return self.func(*args)
root.input_text(state = DISABLED)
TypeError: 'NoneType' object is not callable

also even if this way does work it seems like the wrong way to do it because i would have to create a new function for every widget i wish to disable, surely there is a way to pass variables into functions using the command.
Reply With Quote  
All times are GMT -4. The time now is 5:58 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC