buttonの背景色を赤に変更したいのですが、以下のコードでは変わらず白いままです。
教えて頂ければ嬉しいです。よろしくお願いします。
python
1import tkinter as tk 2 3frame1 = tk.Tk() 4frame1.title('新規') 5 6#ウィジェット 7frame1.geometry('300x400') 8frame1.grid() 9 10#Button1 11def button1_clicked(): 12 frame1.quit() 13 14button1 = tk.Button(frame1, text='あんぱん', command=button1_clicked, bg='red') 15button1.place(x=10,y=0) 16button1.grid(row=2,column=1,columnspan=2) 17 18frame1.mainloop()
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/30 19:14
2019/04/02 09:54