Files @ 3f1b9b9b0505
Branch filter:

Location: light9/light9/curvecalc/cursors.py

drewp@bigasterisk.com
add yapf tool
Ignore-this: 28fe07e21ca358a97282f5316c8820e0

import logging
log = logging.getLogger("cursors")

# accept ascii images, read file images, add hotspots, read xbm as
# cursor with @filename form

_pushed = {} # widget : [old, .., newest]
def push(widget,new_cursor):
    global _pushed
    _pushed.setdefault(widget,[]).append(widget.cget("cursor"))

def pop(widget):
    global _pushed
    try:
        c = _pushed[widget].pop(-1)
    except IndexError:
        log.debug("cursor pop from empty stack")
        return
    widget.config(cursor=c)