ttkwidgets icon indicating copy to clipboard operation
ttkwidgets copied to clipboard

askfont - if I select first font type and then the size it don't work.

Open Jonadabe opened this issue 2 years ago • 2 comments

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.

Jonadabe avatar Jun 02 '22 08:06 Jonadabe

I can confirm this.

rdbende avatar Dec 23 '22 12:12 rdbende

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.

image

kurawlefaraaz avatar Jun 23 '24 13:06 kurawlefaraaz