sclass ImageSurface_PositionToolTip > ImageSurfaceMouseHandler { *(ImageSurface is) { if (containsInstance(is.tools, ImageSurface_PositionToolTip)) ret; register(is); } public void mouseMoved aka mouseDragged(MouseEvent e) { pcall { Pt p = getPt(e); S s = str(p); var img = is.getImage(); if (img != null && p.x >= 0 && p.y >= 0 && p.x < img.getWidth() && p.y < img.getHeight()) { IToolTipMaker toolTipMaker = lookupDynamicInterface_v2 IToolTipMaker(img); if (toolTipMaker != null) s = toolTipMaker.getToolTip(p); else s += " - " + intToHex_fullLength(img.getRGB(p.x, p.y)); } setToolTip(is, s); } } }