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

Can't change foreground color of ttk.Label #137

Open
qwertychouskie opened this issue May 9, 2024 · 3 comments
Open

Can't change foreground color of ttk.Label #137

qwertychouskie opened this issue May 9, 2024 · 3 comments

Comments

@qwertychouskie
Copy link

When the Sun Valley theme isn't loaded, I can change the text color of a label like this:

        style.configure("Red.Label",   foreground='red')
        style.configure("Green.Label", foreground='green')
...
    def send_all_KA(self):
        for module in self.REVModules:
            isAlive = module.sendKA()
            if isAlive == False:
                self.on_quit_button_callback()
                self.Connected_Label.config(text='Disconnected', style='Red.Label')
            else:
                self.Connected_Label.config(text='Connected', style='Green.Label')
                module.getStatus()

However, the text just stays white when the Sun Valley theme is used.

@rdbende
Copy link
Owner

rdbende commented May 13, 2024

I need to look into this, but in the meantime you can use label.config(foreground="red")

@ioctl-user
Copy link

ioctl-user commented May 14, 2024

I need to look into this, but in the meantime you can use label.config(foreground="red")

In recent versions I have similar problem with the style.configure() highlightcolor and foreground parameters. The foreground was working in version 2.5.3.

Could you, please, give similar advice about highlightcolor option? I need creating red border around specific Entries.

@rdbende
Copy link
Owner

rdbende commented May 14, 2024

Configuring the highlightcolor is not possible with ttk widgets. With sv-ttk you can set the "invalid" state on the entry to achieve a similar result.

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

No branches or pull requests

3 participants