Ejemplo n.º 1
0
    def on_changed(self, *args):
        current_values = Combobox.cget(self.vcb, "values")

        cur = Combobox.current(self.vcb)

        new_values = list(current_values)
        new_values[self.idx] = self.var.get()

        Combobox.config(self.vcb, values = new_values)

        if cur == self.idx:
            Combobox.current(self.vcb, cur)
Ejemplo n.º 2
0
    def cget(self, key):
        if "values" == key:
            return [ b.var for b in self.bindings ]

        return Combobox.cget(self, key)