//static double showYesToAcceptPopup_hideAfter = 10.0; sS showYesToAcceptPopup_imageID = #1101458; // #1101459 for "ok" instead of "yes" (wit.ai is bad at recognizing "yes") static YesPopup showYesToAcceptPopup(final Component c, fO... _) { ret swing(func -> YesPopup { final JDesktopPane desktop = parentOfType(c, JDesktopPane.class); if (desktop == null) null; S imageID = optPar(_, imageID := showYesToAcceptPopup_imageID); int width = optPar(_, width := 114); final YesPopup popup = setSizeToPreferredSize(YesPopup(c, imageID, width)); fO mover = optPar(_, 'mover); // voidfunc(Component c, Rect r, Component popup) Runnable moveIt = r { Rect r = boundsInParent(c, desktop); if (mover != null) callF(mover, c, r, popup); else setLocation(popup, r.x+r.w/2, r.y-popup.getHeight()-5); }; desktop.add(popup, JLayeredPane.POPUP_LAYER); onClick(popup, r { removeFromParent(popup) }); callF(moveIt); awtEvery(popup, 100, moveIt); //removeFromParentAfter(showYesToAcceptPopup_hideAfter, popup); ret popup; }); }