#๐ how to change the color of the window frame
29 messages ยท Page 1 of 1 (latest)
@nocturne lintel
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
is that not just the background
is this tkinter?
yes
i think there are no methods included in tkinter to change the window border and title bar.
there is a method to remove them root.overrideredirect(True).
but when you want to change the colors or style, you would have to use a library specific to your operating system.
for example you could use this code to enable dark mode on windows:```py
import ctypes as ct
root.update()
ct.windll.dwmapi.DwmSetWindowAttribute(ct.windll.user32.GetParent(root.winfo_id()), 20, ct.byref(ct.c_int(2)), 4)```
I got this after using ttk.Notebook
this is what it looks like without
but I need ttk.Notebook
what does it do
and did you check why it changes the color
@nocturne lintel https://docs.python.org/3/library/tkinter.ttk.html#tag-options
you have to specify it to the notebook class not child_root
the link I sent directly takes you to the tag options
that tell you the options for appearance customization on the notebook class
I change the background itself but this handle doesn't change.
show your current code
send as text not screenshot
I think it has to do with your sizing. I think you might just be better off styling the background to match or using a style
I can't find anything on how to fix that little gap
I figured out that this is a frame from the tab
for the future if anyone still needs it here is a piece of code to remove the tab border
style = ttk.Style()
style.theme_use('default')
style.configure("TNotebook.Tab", borderwidth=0, padding=[0, 0, 0, 0])
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.