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

How to change the icon in CTkInputDialog #2355

Open
Yuniek opened this issue Apr 4, 2024 · 4 comments
Open

How to change the icon in CTkInputDialog #2355

Yuniek opened this issue Apr 4, 2024 · 4 comments

Comments

@Yuniek
Copy link

Yuniek commented Apr 4, 2024

I was making my software and just encountered an issue with CTkInputDialog. I wanted my icon on the Input Dialog but there is no such attribute that can help me

@Yuniek Yuniek changed the title how to change the icon in CTkInputDialog How to change the icon in CTkInputDialog Apr 4, 2024
@JanPanthera
Copy link

#2302 (comment)

@Yuniek
Copy link
Author

Yuniek commented Apr 5, 2024

#2302 (comment)

Bro, can you please convert this code(in which my custom icon can be displayed) and give it?

import customtkinter
app = customtkinter.CTk()
app.geometry("400x300")


def button_click():
    dialog = customtkinter.CTkInputDialog(text="Type in a number:", title="Test")
    print("Number:", dialog.get_input())


button = customtkinter.CTkButton(app, text="Open Dialog", command=button_click)
button.pack(padx=20, pady=20)

app.mainloop()

@JanPanthera
Copy link

Firstly, I'm not your 'bro,' and secondly, if you can't do it yourself, I recommend learning the basics of programming, googling, and reading documentation. Learning by doing is key. 😹

And, there is also something called ChatGPT, just saying. xD

@JanPanthera
Copy link

JanPanthera commented Apr 5, 2024

Since CTkInputDialog inherits from CTkTopLevel, you can modify the icon by accessing the inherited methods from CTkTopLevel.

Furthermore, since CTkTopLevel inherits from tkinter.Toplevel, you can utilize tkinter.Toplevel's functions to change the icon. It's important to note, as referenced in the comment, that there are specific aspects you need to be aware of; otherwise, you might think it doesn't work.

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

No branches or pull requests

2 participants