下記コードでボタン2がNoneTypeになり,ボタン2の方はClass tkInter Buttunになるのは何故なんでしょうか?
違いは .placeの位置だけなのですが. ボタン生成時に.placeで位置を指定するやり方はよくないのでしょうか.?
PYTHON
1ソースコード 2```import tkinter as tk 3 4app = tk.Tk() 5app.geometry("300x100") 6button1 = tk.Button(app, text="ボタン1",state=tk.DISABLED) 7button2=tk.Button(app,text="ボタン2",state=tk.NORMAL).place(x=100,y=5) 8button1.place(x=10,y=5) 9print(type(button1),type(button2)) 10 11app.mainloop() 12
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/01/13 06:48