0

I need to make a button in tkinter, but for some reason the button has rounded corners. Is there any way to make the button just a simple rectangle with a black border?

Here is my code currently:

button = Button(window=frame, text="Source and Output", width=17, command=info, bg=tkcolour_from_rgb((255, 255, 255)), bd=10, highlightthickness=4, highlightbackground=tkcolour_from_rgb((0, 0, 0)), borderwidth=4, relief="solid")
button.grid(row=0, column=0, padx=(15, 0), pady=15)

the function tkcolour_from_rgb just converts an rgb tuple to a colour for tkinter.

  • I guess you are using `tkinter.Button`. You can use a `ttk.Button` instead and customize the theme. – j_4321 Jul 22 '19 at 12:36
  • @j_4321 how do I do this? I've changed to a ttk button but the edges are still rounded and I can't find any info on how to make them pointy – corpus_callosum Jul 22 '19 at 12:54
  • You can start by taking a look a the different themes available (https://stackoverflow.com/questions/24367710/how-do-i-change-the-overall-theme-of-a-tkinter-application) and if they don't satisfy you, you can have a look at [ttkthemes](https://ttkthemes.readthedocs.io/en/latest/themes.html). You can also edit a theme (see the [documentation](https://docs.python.org/3/library/tkinter.ttk.html#tkinter.ttk.Style) but there is no option to change the corner shape. – j_4321 Jul 22 '19 at 13:00
  • What OS are you using? Are you on OSX? – Bryan Oakley Jul 22 '19 at 13:37

0 Answers0