2

I would like to create a messagebox using R. A short research suggested the tcltk package. The tcltk::tk_messageBox() command actually worked the first time I tried it.

However, I then I updated to Windows 10, switched to R 3.4.3, using RStudio v1.1.423. Now the same command does not work, actually terminating the R Session. A second research showed that this is indeed an issue other users have experienced as well.

So, here is my question: Is there either a way to resolve the compatibility issue of the tcltk library and R/RStudio? Alternatively, is there another package that could produce the same result? (I would like to avoid going as far as shiny, that has been suggested)

1 Answers1

2

With Windows 7, R 3.4.3 and RStudio 1.1.423 I have a similar problem, it looks like RStudio hangs, but in fact, the message-box has popped up, just that it does not become the active window and I have to minimize RStudio to see it.

The command I am running is:

tcltk::tk_messageBox(caption = "Hi", message = "what?", icon = "info", type = "yesno")
RolandASc
  • 3,863
  • 1
  • 11
  • 30
  • Ouch! All this time it was running in the background? Now I feel stupid. It does lose its functionality a bit though if I have to minimize RStudio every time. Is there no way to bring it in the background (even using some R command?) – GerasimosPanagiotakopoulos Feb 27 '18 at 13:24
  • Looks difficult using R, because once it pops up, it's waiting to process your reply first, whereas I cannot find an argument that can be passed to `tk_messageBox` in order to specify that it should get the focus – RolandASc Feb 27 '18 at 13:54
  • I guess that does it. Thank you for your reply! Please feel free to update if you find out anything new. – GerasimosPanagiotakopoulos Feb 27 '18 at 15:34