diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2015-11-06 14:01:56 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2015-11-06 14:03:29 +0100 |
commit | b116635d05647eec6909e844be6034e17ca2f821 (patch) | |
tree | a439dcef4a976ab6098d09c8f158ce832229ac60 /R | |
parent | 21f6a34d935a5fba43692ecd8ead4a688ef31a3d (diff) |
Return the gmkin app from gmkin() and update its documentation
Diffstat (limited to 'R')
-rw-r--r-- | R/gmkin.R | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -1,3 +1,21 @@ +# Copyright (C) 2015 Johannes Ranke +# Contact: jranke@uni-bremen.de + +# This file is part of the R package gmkin + +# gmkin is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. + +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. + +# You should have received a copy of the GNU General Public License along with +# this program. If not, see <http://www.gnu.org/licenses/> + # This makes use of the ::: operator # To avoid this, gWidgetsWWW2 needs to be adapted gmkin <- function(script_name, show.log = FALSE) { @@ -8,10 +26,18 @@ gmkin <- function(script_name, show.log = FALSE) { r_httpd <- gWidgetsWWW2:::R_http$get_instance() r_httpd$start() r_httpd$load_gw(session_manager) - r_httpd$load_app(script_name, "gmkin", session_manager, + gmkin_app <- r_httpd$load_app(script_name, "gmkin", session_manager, open_page = TRUE, show.log = show.log) gmkin_png <- Rook::Static$new( urls = c("/"), root = system.file("GUI/png", package="gmkin")) r_httpd$R$add(Rook::RhttpdApp$new(gmkin_png, name="gmkin_png")) + invisible(gmkin_app) +} + +get_current_session <- function(app) { + s_names <- names(app$session_manager$sessions) + names(app$session_manager$sessions[[s_names[length(s_names)]]]$e) + s_env <- app$session_manager$sessions[[s_names[length(s_names)]]]$e + return(s_env) } |