[UPDATE] Canvas create delete id except background
This commit is contained in:
parent
0fe2dc6d26
commit
0250f65c6f
28
start.py
28
start.py
@ -19,31 +19,36 @@ sys.path.append( './modules/')
|
|||||||
from arrow import *
|
from arrow import *
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def ViewEmu(cL,xL,yL,cM,xM,yM,cR,xR,yR):
|
def ViewEmu(cL,xL,yL,cM,xM,yM,cR,xR,yR):
|
||||||
NfL="./data/emu/media/" + res[cL] + ".png"
|
NfL="./data/emu/media/" + res[cL] + ".png"
|
||||||
print("DEBUG : " + str(cL) + " || FILE : " + NfL )
|
NfM="./data/emu/media/" + res[cM] + ".png"
|
||||||
|
NfR="./data/emu/media/" + res[cR] + ".png"
|
||||||
|
|
||||||
PNfL = PhotoImage(file = NfL)
|
PNfL = PhotoImage(file = NfL)
|
||||||
LabelPNfL = Label(arkadeus, image=PNfL)
|
LabelPNfL = Label(arkadeus, image=PNfL)
|
||||||
LabelPNfL.PNfL = PNfL
|
LabelPNfL.PNfL = PNfL
|
||||||
Cnv.create_image(xL, yL, image=PNfL)
|
|
||||||
|
|
||||||
NfM="./data/emu/media/" + res[cM] + ".png"
|
|
||||||
print("DEBUG : " + str(cM) + " || FILE : " + NfM )
|
|
||||||
PNfM = PhotoImage(file = NfM)
|
PNfM = PhotoImage(file = NfM)
|
||||||
LabelPNfM = Label(arkadeus, image=PNfM)
|
LabelPNfM = Label(arkadeus, image=PNfM)
|
||||||
LabelPNfM.PNfM = PNfM
|
LabelPNfM.PNfM = PNfM
|
||||||
Cnv.create_image(xM, yM, image=PNfM)
|
|
||||||
|
|
||||||
NfR="./data/emu/media/" + res[cR] + ".png"
|
|
||||||
print("DEBUG : " + str(cR) + " || FILE : " + NfR )
|
|
||||||
PNfR = PhotoImage(file = NfR)
|
PNfR = PhotoImage(file = NfR)
|
||||||
LabelPNfR = Label(arkadeus, image=PNfR)
|
LabelPNfR = Label(arkadeus, image=PNfR)
|
||||||
LabelPNfR.PNfR = PNfR
|
LabelPNfR.PNfR = PNfR
|
||||||
Cnv.create_image(xR, yR, image=PNfR)
|
|
||||||
|
|
||||||
Cnv.pack(fill = "both", expand = True)
|
Cnv.pack(fill = "both", expand = True)
|
||||||
|
for IdCanvas in Cnv.find_all():
|
||||||
|
if IdCanvas != 1:
|
||||||
|
Cnv.delete(IdCanvas)
|
||||||
|
|
||||||
|
Cnv.create_image(xL, yL, image=PNfL)
|
||||||
|
Cnv.create_image(xM, yM, image=PNfM)
|
||||||
|
Cnv.create_image(xR, yR, image=PNfR)
|
||||||
|
print("Emu : " + str(res[cM]))
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#Cnv.pack(fill = "both", expand = True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -164,14 +169,11 @@ RightSquareY=(Ysize/3)
|
|||||||
RightSquareX2=RightSquareX + Square
|
RightSquareX2=RightSquareX + Square
|
||||||
RightSquareY2=RightSquareY + Square
|
RightSquareY2=RightSquareY + Square
|
||||||
|
|
||||||
|
|
||||||
ViewEmu(cpt,LeftSquareX, LeftSquareY,cpt+1,MiddleSquareX, MiddleSquareY,cpt+2,RightSquareX, RightSquareY)
|
ViewEmu(cpt,LeftSquareX, LeftSquareY,cpt+1,MiddleSquareX, MiddleSquareY,cpt+2,RightSquareX, RightSquareY)
|
||||||
|
|
||||||
|
|
||||||
arkadeus.bind("<Left>", lambda event: leftKey())
|
arkadeus.bind("<Left>", lambda event: leftKey())
|
||||||
arkadeus.bind("<Right>", lambda event: rightKey())
|
arkadeus.bind("<Right>", lambda event: rightKey())
|
||||||
|
|
||||||
|
|
||||||
arkadeus.bind('<Escape>',Escape)
|
arkadeus.bind('<Escape>',Escape)
|
||||||
|
|
||||||
arkadeus.mainloop()
|
arkadeus.mainloop()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user