In my code, my Entry()
state
is originally as DISABLED
. To enable the input, the user would need to check one of checkbuttons
. Well, at least that's the idea. What happens is that I mark one of the boxes, but the entry is not released so that you can type in it. Here is the snippet of code:
self.sum_l = Label(self.root, text = 'Soma', bg = 'Lightskyblue2')
self.sum_s = IntVar()
self.sum_c = Checkbutton(self.root, bg = 'Lightskyblue2', command = self.Sum, variable = self.sum_s)
self.sub_l = Label(self.root, text = 'Subtração', bg = 'Lightskyblue2')
self.sub_s = IntVar()
self.sub_c = Checkbutton(self.root, bg = 'Lightskyblue2', command = self.Sub, variable = self.sub_s)
self.mult_l = Label(self.root, text = 'Multiplicação', bg = 'Lightskyblue2')
self.mult_s = IntVar()
self.mult_c = Checkbutton(self.root, bg = 'Lightskyblue2', command = self.Mult, variable = self.mult_s)
self.div_l = Label(self.root, text = 'Divisão', bg = 'Lightskyblue2')
self.div_s = IntVar()
self.div_c = Checkbutton(self.root, bg = 'Lightskyblue2', command = self.Div, variable = self.div_s)
self.entry = Entry(self.root, bg = 'white')
if any([self.sum_s.get(), self.sub_s.get(), self.mult_s.get(), self.div_s.get()]):
self.entry['state'] = NORMAL
else:
self.entry['state'] = DISABLED
It's probably something obvious that I did not notice. Can anyone tell you what it is?