!7 cmodule EISM > DynPrintLog { start { ownResource(vmBus_onShowingPopupMenu((component, menu) -> { temp enter(); if (!isShortNamed ImageSurface(component)) ret; print("Image surface popup, enhancing"); File file = cast getOpt file(component); if (file != null) { Rect r = toRect(component~.Rectangle getSelection()); addPopupMenuItem(menu, "Save selection as element...", rThread { inputText("Element name", name -> setFileInfoField(file, name, structOr(r, "-"))); }); } })); } }