mercredi 22 juillet 2020

place() takes from 1 to 2 positional arguments but 3 were given?

I srtuggle with the TypeError: " place_configure() takes from 1 to 2 positional arguments but 3 were given". I don't understand why tkinter has a problem with the number of arguments I give to the place method. Normally I did place(x=45, y=240) and changed the y value all the time in a hard coding style. Now I want to make it easier using variables, for the case that maybe someone wants to change the values one time. When I do this, the Error appears. Thanks for your help already.

        x = 45;
        y = 240;
        self.counter = 0

        

        # Creation of checkbuttons
        self.values_checkboxes_bitness={"32 and 64 Bit": 0, "32 Bit": 1, "64 Bit": 2}
        self.values_checkboxes_debugRelease={"rebug and release": 0, "debug": 1, "release": 2}

        for text in self.values_checkboxes_bitness:
            self.counter+=1
            bitnessCB = Checkbutton( text=text,variable=self.int_var_one, onvalue=self.values_checkboxes_bitness[text], offvalue=3,
                               command=partial(self.checkbox_clicked, self.int_var_one, self.int_var_one_comp,
                                               self.int_var_one_no_checkout,
                                              self.int_var_one_buildtype))
            bitnessCB.pack()
            bitnessCB.config(font=("Helvetica", 10))

        for text in self.values_checkboxes_debugRelease:
            self.counter+=1

        relDebCB =  Checkbutton(text=text,variable=self.int_var_one_comp, onvalue=self.values_checkboxes_debugRelease[text], offvalue=3,
                           command=partial(self.checkbox_clicked, self.int_var_one, self.int_var_one_comp,
                                           self.int_var_one_no_checkout,
                                          self.int_var_one_buildtype))

        relDebCB.config(font=("Helvetica", 10))
        if self.counter > 0:
            y += 30
            relDebCB.place(x,y)
        else:
            relDebCB.place(x,y)```

TypeError: place_configure() takes from 1 to 2 positional arguments but 3 were given







Aucun commentaire:

Enregistrer un commentaire