ttkwidgets
ttkwidgets copied to clipboard
askfont - if I select first font type and then the size it don't work.
This code is inside a window class:
from ttkwidgets.font import askfont
def font():
self.res = askfont()
if self.res[0] is not None:
self.label.configure(font=self.res[0])
print('««««««««', self.res[0])
# return
self.label = ttk.Label(self, text='Texto de exemplo.')
self.label.pack(padx=10, pady=10)
self.botao_fonte = ttk.Button(self, text="Escolher a fonte e tamanho da letra", command=font)
self.botao_fonte.pack()
and if I select the size and then the type font, then it works. But if I select first the type and then the font size it don't.
Thanks.
I can confirm this.
i can also confirm this. I tried to debug this issue but had no success. What i found while debugging is when ever on_size
function is triggered, after its first execution, it again triggers on_family
function. So on first execution it works perfectly preserving the font value, but in the secound execution it changes font to None. No idea how and why its been triggered.