Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make variables private in Tk-backend #26741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions 12 lib/matplotlib/backends/_backend_tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


_log = logging.getLogger(__name__)
cursord = {
_CURSOR_DICT = {
cursors.MOVE: "fleur",
cursors.HAND: "hand2",
cursors.POINTER: "arrow",
Expand All @@ -51,8 +51,8 @@ def _restore_foreground_window_at_end():
# Initialize to a non-empty string that is not a Tcl command
_blit_tcl_name = "mpl_blit_" + uuid.uuid4().hex

TK_PHOTO_COMPOSITE_OVERLAY = 0 # apply transparency rules pixel-wise
TK_PHOTO_COMPOSITE_SET = 1 # set image buffer directly
_TK_PHOTO_COMPOSITE_OVERLAY = 0 # apply transparency rules pixel-wise
_TK_PHOTO_COMPOSITE_SET = 1 # set image buffer directly


def _blit(argsid):
Expand Down Expand Up @@ -97,10 +97,10 @@ def blit(photoimage, aggimage, offsets, bbox=None):
if (x1 > x2) or (y1 > y2):
return
bboxptr = (x1, x2, y1, y2)
comp_rule = TK_PHOTO_COMPOSITE_OVERLAY
comp_rule = _TK_PHOTO_COMPOSITE_OVERLAY
else:
bboxptr = (0, width, 0, height)
comp_rule = TK_PHOTO_COMPOSITE_SET
comp_rule = _TK_PHOTO_COMPOSITE_SET

# NOTE: _tkagg.blit is thread unsafe and will crash the process if called
# from a thread (GH#13293). Instead of blanking and blitting here,
Expand Down Expand Up @@ -434,7 +434,7 @@ def stop_event_loop(self):

def set_cursor(self, cursor):
try:
self._tkcanvas.configure(cursor=cursord[cursor])
self._tkcanvas.configure(cursor=_CURSOR_DICT[cursor])
except tkinter.TclError:
pass

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.