r - Change mouse cursor of a widget in gWidgetsRGtk2 -


i want change mouse cursor hand, clicking image.

hlp<-gimage("help", dirname="stock", size="dialog") addhandlerclicked(hlp, handler=function(h,...) {    browseurl("http://....")}) 

i have read other post related setcursor doesn't work on widgets.

thank you

looking here (how can change shape mouse cursor in gwidgets rgtk2?) can see need rgtk2. try this:

library(rgtk2) w <- gwindow() g <- ggroup(cont=w) gbutton("button", cont=g) img <- gimage("/users/verzani/bubble-gum-art.jpg", cont=g) old_cursor <- gettoolkitwidget(img)$getwindow()$getcursor() cross <- gdkcursornew("gdk_tcross")  addhandler(img, "enter-notify-event", handler=function(h,...) {            gettoolkitwidget(img)$getwindow()$setcursor(cross)            true            })   addhandler(img, "leave-notify-event", handler=function(h,...) {            gettoolkitwidget(img)$getwindow()$setcursor(old_cursor)            true            }) 

that works under mac os x. if doesn't work you, can indicate os trying?


Comments