回答編集履歴

1

Update

2021/12/19 03:08

投稿

melian
melian

スコア20655

test CHANGED
@@ -40,13 +40,13 @@
40
40
 
41
41
  self.button_changebg.place(x=160,y=5)
42
42
 
43
- self.button_changebg.bind("<Button-1>", self.enable_changebg)
43
+ self.button_changebg.config(state="disabled")
44
44
 
45
- self.button_changebg.config(state="disabled")
45
+ self.button_changebg.bind("<Button-1>", self.toggle_changebg)
46
46
 
47
47
 
48
48
 
49
- def enable_changebg(self, _):
49
+ def toggle_changebg(self, _):
50
50
 
51
51
  self.changebg_flag = not self.changebg_flag
52
52
 
@@ -58,9 +58,7 @@
58
58
 
59
59
  if not self.changebg_flag:
60
60
 
61
- return
61
+ return
62
-
63
- # x = self.master.winfo_pointerx()
64
62
 
65
63
  if event.x<100:
66
64
 
@@ -82,4 +80,6 @@
82
80
 
83
81
  app.mainloop()
84
82
 
83
+
84
+
85
85
  ```