79261397

Date: 2024-12-07 21:06:22
Score: 0.5
Natty:
Report link

When I initially created my application, Oblivion's approach worked well for a while. However, as I added more widgets, the customized scheme seemed not working as expected, though the exact issue remains unclear. To get a similar design effect, I used TNotebook and TNotebook.Tab control styles to customize the settings, following an approach similar to @Brōtsyorfuzthrāx.

self.style.theme_use("alt")
self.style.configure("TNotebook",
                             tabmargins = [0, 1, 2, 0],  #[left, top, right, bottom]
                             background="lightgray"
                             ) 
                             
 self.style.configure("TNotebook.Tab",
                             padding = [25, 1.5], 
                             font=("Arial", 10),
                             relief="flat"
                             )
 self.style.map("TNotebook.Tab", 
                       background=[("selected", "skyblue"), ("active", "lightblue")],
                       foreground=[("selected", "white"), ("active", "black")])
Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Brōtsyorfuzthrāx
  • Starts with a question (0.5): When I init
  • Low reputation (0.5):
Posted by: aVral