Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jonadabe opened this issue Jun 2, 2022 · 2 comments
Open
Labels

Comments

@Jonadabe
Copy link

Jonadabe commented Jun 2, 2022

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.

@rdbende rdbende added the bug label Dec 23, 2022
@rdbende
Copy link
Member

rdbende commented Dec 23, 2022

I can confirm this.

@kurawlefaraaz
Copy link

kurawlefaraaz commented Jun 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants