Python tkinter 강좌 : 제 27강 - Progressbar
Progressbar(프로그래스 바)
Progressbar
을 이용하여 현재 진행 상황을 표시하는 프로그래스 바
를 생성할 수 있습니다.
Progressbar 사용
import tkinter
import tkinter.ttk
window=tkinter.Tk()
window.title("YUN DAE HEE")
window.geometry("640x400+100+100")
window.resizable(False, False)
progressbar=tkinter.ttk.Progressbar(window, maximum=100, mode="indeterminate")
progressbar.pack()
progressbar.start(50)
window.mainloop()
import tkinter.ttk
상단에 import tkinter.ttk
를 사용하여 ttk 모듈
을 포함시킵니다.
tkinter.ttk 함수의 사용방법은 tkinter.ttk.*
를 이용하여 사용이 가능합니다.
progressbar=tkinter.ttk.Progressbar(window, maximum=100, mode="indeterminate")
progressbar.pack()
progressbar.start(50)
tkinter.ttk.Progressbar(윈도우 창, 매개변수1, 매개변수2, 매개변수3, ...)
을 사용하여 프로그래스 바의 속성
을 설정할 수 있습니다.
매개변수
를 사용하여 프로그래스 바의 속성
을 설정합니다.
Progressbar Method
이름 | 의미 | 설명 |
---|---|---|
start(ms) | 시작 | 프로그래스 바가 밀리 초 마다 움직임 |
step(value) | 값 증가 | 현재 표시되는 값에서 value 만큼 증가 |
stop() | 종료 | 프로그래스 바 작동 종료 |
Progressbar Parameter
프로그래스 바 형태 설정
이름 | 의미 | 기본값 | 속성 |
---|---|---|---|
length | 프로그래스 바의 너비 | 100 | 상수 |
orient | 프로그래스 바의 표시 방향 | vertical | vertical, horizontal |
mode | 프로그래스 바의 표시 스타일 | determinate | determinate , indeterminate |
프로그래스 바 형식 설정
이름 | 의미 | 기본값 | 속성 |
---|---|---|---|
cursor | 프로그래스 바의 마우스 커서 모양 | - | 커서 속성 |
class_ | 클래스 설정 | - | - |
maximum | 프로그래스 바의 최댓값 설정 | 100 | 상수 |
value | 프로그래스 바의 현재값을 설정 | 0 | 상수 |
variable | 프로그래스 바의 현재값을 가져올 변수 | - | - |
phase | 프로그래스 바의 고유값을 설정 | 0 | 상수 |
프로그래스 바 동작 설정
이름 | 의미 | 기본값 | 속성 |
---|---|---|---|
takefocus | Tab 키를 이용하여 위젯 이동 허용 여부 | False | Boolean |
참고
-
mode 매개변수
determinate
: 표시기가 처음부터 끝까지 채워짐indeterminate
: 표시기가 처음부터 끝까지 반복 이동
-
cursor 매개변수
- arrow, based_arrow_down, based_arrow_up, boat, bogosity, bottom_left_corner, bottom_right_corner, bottom_side, bottom_tee, box_spiral, center_ptr, circle, clock, coffee_mug, cross, cross_reverse, crosshair, diamond_cross, dot, dotbox, double_arrow, draft_large, draft_small, draped_box, exchange, fleur, gobbler, gumby, hand1, hand2, heart, icon, iron_cross, left_ptr, left_side, left_tee, leftbutton, ll_angle, lr_angle, man, middlebutton, mouse, pencil, pirate, plus, question_arrow, right_ptr, right_side, right_tee, rightbutton, rtl_logo, sailboat, sb_down_arrow, sb_h_double_arrow, sb_left_arrow, sb_right_arrow, sb_up_arrow, sb_v_double_arrow, shuttle, sizing, spider, spraycan, star, target, tcross, top_left_arrow, top_left_corner, top_right_corner, top_side, top_tee, trek, ul_angle, umbrella, ur_angle, watch, wait, xterm, X_cursor
공유하기


댓글 남기기