I created a window with the GUI maker pygubu. This window contains checkboxes. But my script is not able to recognize if the checkboxes are marked or not.
How do I have to check if the checkboxes are marked or not?
Do Ihave to use the command or the variable? What is the right syntax?
Below you can see what I have done in pygubu. How do I get the state of my checkbox?
def checker13(self, variable=check13):
self.variable13 = variable
Finally I found an inelegant way to do it. It's not very "pretty", but it works:
self.xxx1 = 0 def checker13(self): if self.xxx1 == 0: self.xxx1 = self.xxx1+1 else: self.xxx1 = 0
Normally the checkbox is not marked and the value is
0. If the checkbox gets marked there is an event and the value changes to
1. The next event changes the value back to
0. By this method I can check the state of the checkbox by checking
I knew there are other ways (with
IntVar()) but I was specifically searching for a solution with pygubu. If there is a smoother answer feel free to correct me.