I was trying to make a subclass that acts like the original but its go function returned the string of the text of the button, instead of the index of the button.
My own defined subclass makes the second, third, and so forth buttons rectangular. Also - My OS is macOS 15.5. Tkinter version is 8.6.14.
Original tkinter.simpledialog.SimpleDialog Result in the Test:

My defined Subclass' Result in the Test:

from tkinter import simpledialog, Tk
class SimpleDialog(simpledialog.SimpleDialog):
def __init__(self, master, text='', buttons=None, default=0, cancel=None, title=None, **kw):
self.buttons = buttons or []
super().__init__(master, text=text, buttons=buttons, default=default, cancel=cancel, title=title, **kw)
def go(self) -> str:
return self.buttons[super().go()]
buttons = ['hi', 'yo']
simpledialog.SimpleDialog(master = Tk(), buttons = buttons).go() # Result: A dialog that shows buttons ('hi', 'yo') of curved edges
SimpleDialog(master = Tk(), buttons = buttons).go()
# Expected Result: A dialog that shows buttons ('hi', 'yo') of curved edges
# Actual Result: A dialog that shows the first button, 'hi', but the second button, 'yo', is slightly longer and the edges are pointed (like a rectangle)
Tried adding more buttons to the list or having a button with a long text. Didn't work.
No idea why my new subclass' first button has its edges curved, but the second and so forth buttons look rectangular, but the original has its edges curved for all buttons. There were no errors though.
default=Noneto bothSimpleDialogandsimpledialog.SimpleDialog. If the problem persist, it's most likely a bug intcl(whattkinterinterfaces with to create/manipulate windows/widgets)default = Noneinto my defined subclass, unlike the original?default=Nonebut your class usesdefault=0and maybe it makes difference fortcltkinter's source code,tkintercalls.config(relief=RIDGE, borderwidth=8)on the default button. For some reason that messes with the other buttons and removes their roundness. I suspect this is actually a bug intclbut I have no way of testing it