Rounded button tkinter python

前端 未结 4 961
无人共我
无人共我 2021-02-13 03:23

I am trying to get rounded buttons for my script using tkinter.

I found the following code:

from tkinter import *
import tkinter as tk

class CustomButto         


        
4条回答
  •  不思量自难忘°
    2021-02-13 04:14

    You need to create root window first (or some other widget) and give it to your CustomButton together with different parameters (see definition of __init__ method).

    Try instead of app = CustomButton() the following:

    app = tk.Tk()
    button = CustomButton(app, 100, 25, 'red')
    button.pack()
    app.mainloop()
    

提交回复
热议问题