[R] tkfocus issue

Hao Liu hao.liu at bms.com
Wed Jul 11 17:43:10 CEST 2007


Dear All:

I am stuck with this issue:

I have a button on a TK window, once click it, it pops up a individual 
plot device:

 individual_plot <- function() {
     tkconfigure(overlay.button, state="normal")
    options(locatorBell = FALSE)
     plotfuntype()
     trellis.focus("panel", 1, 1,highlight=FALSE)
     panel.identify(labels=colnames(dataplot))
}

Now I have another button, originally state="disabled", but activated by 
: tkconfigure(overlay.button, state="normal") in previous function:

The overlay function was writen to overlay another plot to the original 
plot.

--The problem:

1.    once the plot device is out, I can't go back to the Tk window, it 
is take hostage by the plot image some how. As a result, overlay button 
won't work.

2. Is there a mechanism to detect close/destroy of the plotting device 
in R? I want to use that even to make overlay.button state to "disabled" 
so user won't be able to click overlay just to get an error message if 
there is no plot already exist...


Thanks
Hao



More information about the R-help mailing list