1

I have a small Python GUI that is simply a smaller and less advanced version of Microsoft's Notepad. It allows the loading and saving of files and such, and a few other basic menu options such as exiting.

Tkinter works generally well for creating such programs, but I would like to know whether it is possible to use the much nicer looking Windows 10 buttons than to be stuck with the rather ugly looking Tkinter ones. (see difference below, Tkinter is the top picture, Windows is the lower one).

enter image description here

enter image description here

I know it's a bit of an obscure problem, but if anyone knows whether this is possible I'd be very pleased. Nothing makes me happier than a clean looking program :) I have my doubts though...

Below is the code used for my current buttons (I am aware of how awkward .place is, but it works for me at the minute) :)

yes = Button(confirmation, text = "Yes", command = ProgramTerminate, width = 5, height = 1)
yes.place(x = 100, y = 25)

no = Button(confirmation, text = "No", command = confirmation.destroy, width = 5, height = 1)
no.place(x = 150, y = 25)

1 Answer 1

3

No. You can get at windows 7ish look by using ttk:

from tkinter import ttk
yes = ttk.Button(confirmation, text = "Yes", command = ProgramTerminate, width = 5, height = 1)

However, I see you are making a yes / no message box. You can call the system's version of that using messagebox.askyesno:

from tkinter import messagebox

response = messagebox.askyesno("Really Quit?", "Are you sure you want to quit?")
if response:
   ProgramTerminate()
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Closer than what I was doing, It looks a lot more professional now :)
"height" option is not yet implemented in tkk.button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.