OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

ttkthemes doesn't theme entire window when applied to root

  • Thread starter Thread starter SudoAptWhy UPDATE
  • Start date Start date
S

SudoAptWhy UPDATE

Guest
None of the themes I've tried in ttkthemes will theme the entire window. I apply the theme to the root/self and it will only theme text/buttons

Screenshots:

Window

I was expecting the window to fill the entire way, is there something I'm missing?

Code:

Code:
class Window(ThemedTk):
    def __init__(self):
        ThemedTk.__init__(self)

        self.tk.call('lappend', 'auto_path', 'correct_path_to_theme')
        self.tk.call('package', 'require', 'awdark')
        s = ttk.Style()
        s.theme_use("awdark")

        # frame all content will sit inside of
        mainframe = ttk.Frame(self, width=self.width, height=self.height)
        mainframe.pack(side="top", fill="both", expand=True)


        self.frames = {}

        for F in (
            HomePage,
        ):
            frame = F(mainframe, self)


            self.frames[F] = frame
            frame.grid(row=0, column=0, sticky="nsew")

        self.show_frame(HomePage)

    def show_frame(self, fr):
        frame = self.frames[fr]
        frame.tkraise()


# Home Page of the app
class HomePage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)

        

        # header label
        header_label = ttk.Label(
            self, text="Post Visual Inspection Board Capture Program", justify="center"
        )
        header_label.pack()

        # will start the new capture process
        new_capture_buton = ttk.Button(
            self,
            text="New Capture",
            command=lambda: controller.show_frame(InstructionsPage),
        )

        new_capture_buton.place(relx=0.5, rely=0.5, anchor=tk.CENTER)
<p>None of the themes I've tried in ttkthemes will theme the entire window. I apply the theme to the root/self and it will only theme text/buttons</p>
<p>Screenshots:</p>
<p><a href="https://i.sstatic.net/KC6q1jGy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KC6q1jGy.png" alt="Window" /></a></p>
<p>I was expecting the window to fill the entire way, is there something I'm missing?</p>
<p>Code:</p>
<pre><code>class Window(ThemedTk):
def __init__(self):
ThemedTk.__init__(self)

self.tk.call('lappend', 'auto_path', 'correct_path_to_theme')
self.tk.call('package', 'require', 'awdark')
s = ttk.Style()
s.theme_use("awdark")

# frame all content will sit inside of
mainframe = ttk.Frame(self, width=self.width, height=self.height)
mainframe.pack(side="top", fill="both", expand=True)


self.frames = {}

for F in (
HomePage,
):
frame = F(mainframe, self)


self.frames[F] = frame
frame.grid(row=0, column=0, sticky="nsew")

self.show_frame(HomePage)

def show_frame(self, fr):
frame = self.frames[fr]
frame.tkraise()


# Home Page of the app
class HomePage(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)



# header label
header_label = ttk.Label(
self, text="Post Visual Inspection Board Capture Program", justify="center"
)
header_label.pack()

# will start the new capture process
new_capture_buton = ttk.Button(
self,
text="New Capture",
command=lambda: controller.show_frame(InstructionsPage),
)

new_capture_buton.place(relx=0.5, rely=0.5, anchor=tk.CENTER)
</code></pre>
 

Latest posts

I
Replies
0
Views
1
Isaac P. Liu
I
U
Replies
0
Views
1
user3658366
U
G
Replies
0
Views
1
Giampaolo Levorato
G
M
Replies
0
Views
1
Marcelo Rodrigo Nascimento
M
Top