`cursors` — Tk에서 쓸 수 있는 마우스 커서
cursors — Tk에서 쓸 수 있는 마우스 커서
위젯마다 마우스를 올렸을 때 보이는 커서를 바꾸고 싶을 때가 있어요. 텍스트 입력 칸에선 I자 모양, 크기 조절 영역에선 양방향 화살표 모양처럼 말이에요. Tk는 -cursor 위젯 옵션으로 이걸 쉽게 바꾸도록 미리 정해둔 이름들을 제공해요.
본문
-cursor 위젯 옵션을 쓰면 특정 위젯의 마우스 커서를 바꿀 수 있어요. Tk가 모든 플랫폼에서 인식하는 커서 이름은 다음과 같아요.
X_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
none
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
xterm
none 커서를 지정하면 커서를 아예 없앨 수 있어요.
플랫폼별 차이
Windows
Windows에서는 다음 커서들이 네이티브 커서로 매핑돼요.
arrow
center_ptr
crosshair
fleur
ibeam
icon
none
sb_h_double_arrow
sb_v_double_arrow
watch
xterm
그리고 다음 추가 커서도 쓸 수 있어요.
no
starting
size
size_ne_sw
size_ns
size_nw_se
size_we
uparrow
wait
macOS
macOS에서는 다음 커서들이 네이티브 커서로 매핑돼요.
arrow
top_left_arrow
left_ptr
cross
crosshair
tcross
ibeam
none
xterm
그리고 다음 추가 네이티브 커서도 쓸 수 있어요.
copyarrow
aliasarrow
contextualmenuarrow
movearrow
text
cross-hair
hand
openhand
closedhand
fist
pointinghand
resize
resizeleft
resizeright
resizeleftright
resizeup
resizedown
resizeupdown
resizebottomleft
resizetopleft
resizebottomright
resizetopright
notallowed
poof
wait
countinguphand
countingdownhand
countingupanddownhand
spinning
help
bucket
cancel
eyedrop
eyedrop-full
zoom-in
zoom-out
더 알아보기
options 문서의 -cursor 항목과 함께, 위젯 상태(-state·-active*)에 따라 커서를 다르게 주는 방식도 확인해 보세요.