From b6f8103d705f8519edbedaf45e8881b7a13054ed Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 10 Nov 2015 14:40:37 +0100 Subject: Open a windows plotting device if appropriate --- inst/GUI/gmkin.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inst/GUI/gmkin.R b/inst/GUI/gmkin.R index 75b86b3..08c4150 100644 --- a/inst/GUI/gmkin.R +++ b/inst/GUI/gmkin.R @@ -913,6 +913,13 @@ run_fit_handler <- function(h, ...) { #{{{3 err = NULL } reweight.method <- svalue(f.gg.opts.reweight.method) + if (svalue(f.gg.opts.plot)) { + if (.Platform$OS.type == "windows") { + # When on windows, check for an active windows device. If not present, + # open one + if (attr(dev.cur(), "names") != "windows") windows() + } + } if (reweight.method == "none") reweight.method = NULL ftmp <<- mkinfit(m.cur, override(ds.cur$data), state.ini = iniparms, @@ -1032,8 +1039,8 @@ f.gg.opts.g <- ggroup(cont = f.config) # First group {{{4 f.gg.opts.1 <- gformlayout(cont = f.gg.opts.g) solution_types <- c("auto", "analytical", "eigen", "deSolve") -f.gg.opts.plot <- gcheckbox("Plot during the fit", - cont = f.gg.opts.1, checked = FALSE) +f.gg.opts.plot <- gcheckbox("Plot during the fit", + cont = f.gg.opts.1, checked = FALSE) f.gg.opts.st <- gcombobox(solution_types, selected = 1, label = "solution_type", width = 160, cont = f.gg.opts.1) -- cgit v1.2.1