NEED HELP IN SHINY APPS FOR DISABLE SHINAY MAIN APPS WINDOW OR DISABLE THE CLOSE BUTTON.
Shiny Apps program scenario :
I am calling a C# function from my shiny apps using "rclr" module.
That "C#" function will open a gateway window to fetch "data frame" from C# application to R.
What Problem I am getting:
-
When it's calling the cross-platform "C#" application window by calling the C# function from R,
THAT WINDOW IS NOT COMING IN FRONT OF SHINY APPS MAIN PANEL.
EVERY TIME I AM USING "ALT+TAB" TO GET THE 3RD PARTY WINDOW BACK.MEANWHILE, IF I CLOSE THE SHINY APPS MAIN PANEL, WHEN 3RD PARTY WINDOW STILL RUNNING OR ALIVE OR NOT CLOSED THEN I AM GETTING ERROR
AND RSTUDIO IS GETTING HANGED.
To address the issue below options i was tring:
- Tring to disable the main shiny panel window disable or hidden when 3rd party process is running. So that nobody can close the main shiny panel window.
- Tring to disable or hide shiny main panel top right corner window close button. So that nobody can close the main shiny panel window when 3rd party process is running.
BUT NITHER WAY I GOT ANY SOLUTION TO ADDRESS THIS ISSUE.
AND NOT ABLE TO FIND ANY CODE WHICH WILL HELP TO DISABLE THE MAIN SHINY APPS WINDOW OR DISABLE THE CLOSE BUTTON.
LOOKING FOR HELP TO ADDRESS THE SAME. ANY KIND OF SUGGESTIONS, APPROACH AND HELP FOR THIS PROBLEM APPRECIATED.
Please find below the part of code for better understanding the problem scenario
Lets take below example.
rm(list=ls())
library(shiny)
# shiny apps/browser is 1st window
doshiny <- function() {
app=shinyApp(
ui = fluidPage(
bsButton("CLICK_ME", label = "CLICK ME", block = TRUE, width = 90, style="primary")
),
server = function(input, output, session) {
observeEvent( input$CLICK_ME,{
print("Cliecked !")
GetDataFrameFunResult = GetDataFrameFun (); # one new window will open (2nd window from dll)
})
session$onSessionEnded(function() {
stopApp()
})
}
)
runApp(app)
}
openshiny <- function() {
doshiny()
print("Finished.")
}
GetDataFrameFun <- function(){ # function call GetDataFrame(), its will open a c# window
connectorObj <- GetConnectorObj()
return( clrCall( connectorObj, 'GetDataFrame' ) )
}
GetConnectorObj <- function(){ # CLR call
WD <- getwd()
PATH <- paste( WD, '/target.dll', sep="" )
rClr::clrLoadAssembly( PATH );
return( clrNew( 'namespaceName.className' ) )
}
openshiny()
now my objective is, do not allow a user to close the 1st window when 2nd window is still open.