@larch.ValidateLarchPlugin
def _getcursor(win=1, timeout=30, _larch=None, wxparent=None, size=None, **kws):
    plotter = _getDisplay(wxparent=wxparent, win=win, size=size, _larch=_larch)
    symtable = ensuremod(_larch, MODNAME)
    sentinal = '%s.plot%i_cursorflag' % (MODNAME, win)
    xsym = '%s.plot%i_x' % (MODNAME, win)
    ysym = '%s.plot%i_y' % (MODNAME, win)

    xval = symtable.get_symbol(xsym, create=True)
    yval = symtable.get_symbol(ysym, create=True)
    symtable.set_symbol(sentinal, False)

    def onChange(symbolname=None, **kws):
        symtable.set_symbol(kws['sentinal'], True)

    symtable.add_callback(xsym, onChange, kws={'sentinal': sentinal})

    t0 = time.time()
    while time.time() - t0 < timeout:
        wx_update(_larch=_larch)
        if symtable.get_symbol(sentinal):
            break
    symtable.del_symbol(sentinal)
    symtable.clear_callbacks(xsym)
    return (symtable.get_symbol(xsym), symtable.get_symbol(ysym))
get_cursor(win=1, timeout=30)
dataset/ETHPy150Open xraypy/xraylarch/plugins/wx/plotter.py/_getcursor