You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I tried running the above piece of code with ttkbootstrap themes but the bg/fg/font selected to the text is not applied on the final tkinter window, its still the same basic settings. This used to work fine in ttkbootstrap_v < 1.0.0.0, but in later versions Im facing this issue. Any fix for this...??
Thanks in advance.
The text was updated successfully, but these errors were encountered:
@Crystz99, yes, you are correct. In ttkbootstrap 1.0, there is a default style applied to tk widgets. There is a publisher that tracks the legacy tk widgets and ensures that whenever the theme is changed or updated, a default style is applied to all those legacy widgets. This is the intended behavior, however, I can see how it could potentially be annoying if you wanted to update a legacy widget.
A temporary hack you can use now is to unsubscribe the widget from the Publisher and then configure the style settings.
importttkbootstrapasttkfromttkbootstrap.constantsimport*fromttkbootstrap.publisherimportPublisherapp=ttk.Window()
txt=ttk.Text()
txt.pack(fill=BOTH)
# get the widget namewidget_name=str(txt)
# unsubscribe the name from Published update eventsPublisher.unsubscribe(widget_name)
# configure the widget styletxt.configure(background='#000000', foreground='#ffffff', font="Consolas 12 bold")
app.mainloop()
A potential long-term solution may be to add a themed parameter that would prevent the widget from getting registered with the Publisher.
Hi,
I tried running the above piece of code with ttkbootstrap themes but the bg/fg/font selected to the text is not applied on the final tkinter window, its still the same basic settings. This used to work fine in ttkbootstrap_v < 1.0.0.0, but in later versions Im facing this issue. Any fix for this...??
Thanks in advance.
The text was updated successfully, but these errors were encountered: