search for: xycoordsrelease

Displaying 1 result from an estimated 1 matches for "xycoordsrelease".

2009 Dec 22
1
RGtk2 - retrieve ggraphics mouse coordinates during drag-and-drop event
...sed at:", c(x,y))) }) da <- g at widget@widget callbackID <- gSignalConnect(da,"button-release-event", function (w,e,...) { allocation = w$GetAllocation() xclick = e$GetX() yclick = e$GetY() x = xclick/allocation$width y = (allocation$height - yclick)/allocation$height xyCoordsRelease <- pltToUsr(x,y) print(c("released at:", pltToUsr(x,y))) xMove <- xyCoordsRelease[1] - xStart yMove <- xyCoordsRelease[2] - yStart print(c("xMove", round(xMove, 3), "yMove", round(yMove, 3))) plot(rnorm(20), col="red") #print(qplot(rnorm(100),...