aboutsummaryrefslogtreecommitdiff
path: root/inst
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2015-10-26 15:24:06 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2015-10-26 15:24:06 +0100
commit175529712bba41ba0db09fea44ed4d568452ae8f (patch)
tree3875319b78d1c007987869e8e7ad592a044715d0 /inst
parentb85a3aaf049dd6e0b06fe5892789b10fe06e5d8e (diff)
Fixed errors and a warning
Errors were caused by GTable returning NULL when the index is set to NA. Tried to avoid this by adapting GTable$set_index() but I did not get it right.
Diffstat (limited to 'inst')
-rw-r--r--inst/GUI/gmkin.R16
1 files changed, 11 insertions, 5 deletions
diff --git a/inst/GUI/gmkin.R b/inst/GUI/gmkin.R
index 72631b8..66e1515 100644
--- a/inst/GUI/gmkin.R
+++ b/inst/GUI/gmkin.R
@@ -213,7 +213,9 @@ ds.switcher <- function(h, ...) {
update_ds_editor()
ds.delete$call_Ext("enable")
ds.copy$call_Ext("enable")
- if (!is.na(svalue(m.gtable))) f.conf$call_Ext("enable")
+ if (!is.null(svalue(m.gtable, index = TRUE))) {
+ if (!is.na(svalue(m.gtable))) f.conf$call_Ext("enable")
+ }
svalue(center) <- 2
svalue(right) <- 2
}
@@ -227,7 +229,9 @@ m.switcher <- function(h, ...) {
update_m_editor()
m.delete$call_Ext("enable")
m.copy$call_Ext("enable")
- if (!is.na(svalue(ds.gtable))) f.conf$call_Ext("enable")
+ if (!is.null(svalue(ds.gtable, index = TRUE))) {
+ if (!is.na(svalue(ds.gtable))) f.conf$call_Ext("enable")
+ }
svalue(center) <- 3
svalue(right) <- 3
}
@@ -247,8 +251,10 @@ f.switcher <- function(h, ...) {
c.m$call_Ext("setText",
paste0("<font color='gray'>", ftmp$mkinmod$name, "</font>"), FALSE)
f.conf$call_Ext("disable")
- ds.gtable$clear_selection()
- m.gtable$clear_selection()
+
+ ds.gtable$set_index(NA)
+ m.gtable$set_index(NA)
+
show.initial.gb.o$call_Ext("enable")
update_f_conf()
show_plot("Optimised")
@@ -1096,7 +1102,7 @@ plot_ftmp <- function() {
if (length(svalue(f.gg.po.obssel)) == 0) {
gmessage("Please select more than one variable for plotting.")
} else {
- if(svalue(f.gg.po.obssel) != "") {
+ if(svalue(f.gg.po.obssel)[1] != "") {
obs_vars_plot = svalue(f.gg.po.obssel)
} else {
obs_vars_plot = names(ftmp$mkinmod$spec)

Contact - Imprint