Skip to content

Instantly share code, notes, and snippets.

@seankross
Created October 6, 2017 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seankross/47e17ef1ab40a1060c1d80a86a3a9616 to your computer and use it in GitHub Desktop.
Save seankross/47e17ef1ab40a1060c1d80a86a3a9616 to your computer and use it in GitHub Desktop.
library(shiny)
library(miniUI)
ui <- miniPage(
gadgetTitleBar("My Gadget"),
miniContentPanel(
## Your UI items go here.
)
)
server <- function(input, output, session) {
## Your reactive logic goes here.
# Listen for the 'done' event. This event will be fired when a user
# is finished interacting with your application, and clicks the 'done'
# button.
observeEvent(input$done, {
# Here is where your Shiny application might now go an affect the
# contents of a document open in RStudio, using the `rstudioapi` package.
#
# At the end, your application should call 'stopApp()' here, to ensure that
# the gadget is closed after 'done' is clicked.
stopApp()
})
}
runGadget(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment