diff --git a/TkEasyGUI/utils.py b/TkEasyGUI/utils.py index 81d1c8b..d3438e1 100644 --- a/TkEasyGUI/utils.py +++ b/TkEasyGUI/utils.py @@ -24,6 +24,11 @@ ReliefType = Literal["flat", "groove", "raised", "ridge", "solid", "sunken"] KeyType = Union[str, int] ColorFormatType = Literal["html", "rgb", "tuple"] +CursorType = Literal["arrow", "circle", "cross", "dotbox", "exchange", "fleur", + "hand1", "hand2", "heart", "man", "mouse", "pirate", "plus", + "shuttle", "sizing", "spider", "spraycan", "star", "target", + "tcross", "trek", "watch", "xterm", "ibeam", "wait", + "size", "size_all", "size_nw_se", "size_ne_sw", "size_we", "size_ns"] # ------------------------------------------------------------------- # clipboard diff --git a/TkEasyGUI/widgets.py b/TkEasyGUI/widgets.py index 9287e03..d31e61e 100644 --- a/TkEasyGUI/widgets.py +++ b/TkEasyGUI/widgets.py @@ -21,6 +21,7 @@ from . import dialogs, utils, version from .utils import ( # type alias + CursorType, EventMode, FontType, ListboxSelectMode, @@ -1269,6 +1270,11 @@ def get(self) -> Any: def update(self, *args, **kw) -> None: """update widget configuration.""" pass + + def set_cursor(self, cursor: CursorType) -> None: + """Set the cursor.""" + if self.widget is not None: + self.widget.config(cursor=cursor) def _widget_update(self, **kw) -> None: # update element's props