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

Added kwargs passthrough to tkinter.Tk on init of Window #558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dimsanius
Copy link

Hello,

First of all, thanks for providing such a nice wrapper around basic tkinter application. This modules allows to achieve a really nice looking tkinter application as opposed to using bare tkinter app.

I have noticed that Window class usage is preffered as opposed to tkinter.Tk() when creating main/root window of an application. However, I have realised that Window class is missing some argument passthrough functionality - when Window's class super(in this case - tkinter.Tk()) class init method is called, there is no possibility to pass some arguments which are available according to an official tkinter documentation.

Hence, I have added missing functionality in.

Motivation behind it is following - I am using Ubuntu with GNOME environment. When creating a tkinter window using Window class, it creates an app which name defaults to Tk when I am hovering over the icon of the running app. In order to adjust it, I must change the value of className. However, there is no way of controlling it from Window class & I am not willing to revert back to "old" way of creating a window via calling tkinter.Tk() myself. Hence, I decided to make my contribution at this stage to lift the limitation of ttkbootstrap's Window class as this is where the limitation resides.

Current behaviour on Ubuntu using GNOME:
image

Proposed change allows to change the pop-up text using className under Ubuntu GNOME:
image

Below is the minimal code that I used to achieve the result displayed above:

import ttkbootstrap as ttk

class RootWindow(ttk.Window):

    def __init__(self):
        super().__init__(className="My awesome app")

app = RootWindow()
app.mainloop()

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

Successfully merging this pull request may close these issues.

None yet

1 participant