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

Change the frame backgrounf color of the LED widget. #50

Closed
optio50 opened this issue Mar 19, 2022 · 3 comments
Closed

Change the frame backgrounf color of the LED widget. #50

optio50 opened this issue Mar 19, 2022 · 3 comments

Comments

@optio50
Copy link

optio50 commented Mar 19, 2022

Is there a way to change the background color of the frame in the LED widget?
Its always a white square with the led in the center. Typical frame color options error out such as bg='grey' or background='grey'
in the docs it says **options "The frame options". What exactly are the frame options?

Thank you.

@slightlynybbled
Copy link
Owner

LED widget is built on a ttk.Frame. The **options will get passed into that widget. See ttk.Frame documentation for more details.

When I run the examples/leds.py, I don't see a white background. Could you run the example directly from the repository and verify?

@optio50
Copy link
Author

optio50 commented Mar 24, 2022

Using the example and changing the root bg color.
root.configure(bg='black')
There is a white frame around the LED.
Using ttk style options only seems to change the narrow outer layer color and still leaves the white square around the LED.
typical tkinter bg and fg options have no effect.

I can get the desired effect by directly modifying the canvas.py file and using the typical bg fg options on line 520.
https://github.com/slightlynybbled/tk_tools/blob/master/tk_tools/canvas.py

Thanks for taking the time to assist

@slightlynybbled
Copy link
Owner

Have made the canvas widgets based on tk.Frame instead of ttk.Frame to ease this in the future. Thanks for taking a look!

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

2 participants