slightlynybbled / tk_tools

Python tkinter tools, Python3.7+
MIT License
101 stars 25 forks source link

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

Closed optio50 closed 2 years ago

optio50 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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