Tkinter旋转调整大小光标

2024-06-26 01:32:21 发布

您现在位置:Python中文网/ 问答频道 /正文

所以我正在使用Tkinter游标,我找到了它提供的所有游标的列表:https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/cursors.html

现在我对这些感兴趣:

enter image description here

这些光标是在调整窗口大小时显示的光标,但缺少一些。当您在两个方向(宽度和高度)上调整窗口的大小时,您会得到一个45度旋转的箭头光标,它不属于此列表的一部分

那么,Tkinter提供了光标吗?有没有办法添加光标并使用它


Tags: httpsiogithubdocs列表tkinterhtml小时
1条回答
网友
1楼 · 发布于 2024-06-26 01:32:21

答案是肯定的:

import tkinter as tk


window = tk.Tk()

tk.Label(window, bg='red', width=50, height=20,cursor='size_ne_sw').pack(expand=True, fill='both')


window.mainloop()

details

相关问题 更多 >