-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode10-12.py
More file actions
40 lines (32 loc) · 984 Bytes
/
code10-12.py
File metadata and controls
40 lines (32 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from tkinter import *
fnameList = ["jeju1.gif","jeju2.gif","jeju3.gif","jeju4.gif","jeju5.gif","jeju6.gif",
"jeju7.gif","jeju8.gif","jeju9.gif"]
photoList = [None] * 9
num = 0
def clickNext() :
global num
num += 1
if num > 8 :
num = 0
photo = PhotoImage(file="gif/"+fnameList[num])
pLabel.configure(image = photo)
pLabel.image = photo
def clickPrev() :
global num
num -= 1
if num < 0 :
num = 8
photo = PhotoImage(file="gif/"+fnameList[num])
pLabel.configure(image = photo)
pLabel.image = photo
window = Tk()
window.geometry("700x500")
window.title("사진 앨범 보기")
btnPrev = Button(window, text = "<< 이전", command = clickPrev)
btnNext = Button(window, text = "다음 >>", command = clickNext)
photo = PhotoImage(file = "gif/" + fnameList[0])
pLabel = Label(window, image = photo)
btnPrev.place(x = 250, y = 10)
btnNext.place(x = 400, y = 10)
pLabel.place(x = 15, y = 50)
window.mainloop()