I am the maintainer of a Bioconductor package (affylmGUI) which uses tcltk. It freezes inconsistently on MS Windows, but not Mac or Unix. see details below. After considerable testing I have reduced the problem from a few thousand lines of code to 30 lines! If you paste the following lines of code into an R window: testGUI <- function(){ require(tcltk) MainWindow <- tktoplevel() topMenu <- tkmenu(MainWindow) tkconfigure(MainWindow,menu=topMenu) normalizeMenu <- tkmenu(topMenu, tearoff=FALSE) tkadd(normalizeMenu,"command",label="Normalize",command = function() NormalizeNow(MainWindow)) tkadd(topMenu, "cascade", label="MainWindow", menu = normalizeMenu) tkfocus(MainWindow) # }#end of testGUI <- function() # NormalizeNow <- function(MainWindow){ NMethod <- GetNMethod(MainWindow) if (NMethod=="") return() tkconfigure(MainWindow,cursor="watch") tkfocus(MainWindow) }#end of NormalizeNow <- function(){ # GetNMethod <- function(MainWindow){ ReturnVal <- "RMA" GNMethod <- tktoplevel(MainWindow) tkwm.deiconify(GNMethod) tkgrab.set(GNMethod) tkfocus(GNMethod) tkwm.title(GNMethod,"Get Method") tkbind(GNMethod,"<Destroy>",function() {ReturnVal <- "";tkgrab.release(GNMethod);tkfocus(MainWindow);}) tkwait.window(GNMethod) return (ReturnVal) }#end of GetNMethod <- function() and then run the function testGUI() A Main Window pops up with "Main Window" in the Menu bar. Click on "Main Window" and the first (and only) item on the menu drops down and it is called "Normalize". Clicking this opens another windows entitled "Get Method". If there is a problem (it is intermittent), it is evidenced by the fact that the "Get Method" window will not close. It cannot be closed by clicking. The window is frozen open. It can be moved but not closed. On MS Windows, the "Get Method" window can be closed using the right button close window option on the task bar icon Typically the problem occurs infrequently in the first 10 presses on the "Normalize" item, but more frequently there after. I have NOT had the problem on Mac OSX or Linux. On MS Windows (I have tested on Win XP-32bit and Win7-64bit) the problem occurs in R-2.16.0, R-2.15.2, R-2.15.1,R-2.14.0. THERE IS NO PROBLEM WITH R-2.13.1 and R-2.13.0 I have run it using debug("GetNMethod"). Stepping through the GetNMethod function results in freezing when asked to do the "tkgrab.set(GNMethod)" instruction. I would appreciate if others can confirm similar behaviour. Can anyone suggest why it worked under R-2.13.x but not in later versions of R. Was there a change in R that impacts with this aspect of tcltk? Is there a work around for this problem? Any suggestions appreciated, thanks Keith Satterley affylmGUI, limmaGUI maintainer. Bioinformatics Division The Walter and Eliza Hall Institute Melbourne, Australia. Some sessionInfo() outputs: Win7-64bit-R-2.15.2 testGUI() fails intermittently. > sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=C [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C [5] LC_TIME=English_Australia.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base Linux x64-R-2.15.2. testGUI() works always R version 2.15.2 (2012-10-26) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] tcltk stats graphics grDevices utils datasets methods [8] base Mac OS X R-2.15.2. testGUI() works always > sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) locale: [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base WinXP-32bit--R-2.15.2. testGUI() fails intermittently > sessionInfo() R version 2.15.2 (2012-10-26) Platform: i386-w64-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C [5] LC_TIME=English_Australia.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base Win7-R-2.13.1. testGUI() works always > sessionInfo() R version 2.13.1 (2011-07-08) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=C [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C [5] LC_TIME=English_Australia.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods base ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
Hi Keith, I confirm that the problem of tcltk freezing window was reported by windows oneChannelGUI users. I also submitted the problem to R-bugs, but I could not manage to convince them that the problem is not due to the package. Cheers Raffaele On 11/19/12 6:05 AM, Keith wrote:> I am the maintainer of a Bioconductor package (affylmGUI) which uses > tcltk. It freezes inconsistently on MS Windows, but not Mac or Unix. > see details below. > > After considerable testing I have reduced the problem from a few > thousand lines of code to 30 lines! > > If you paste the following lines of code into an R window: > > > testGUI <- function(){ > require(tcltk) > MainWindow <- tktoplevel() > topMenu <- tkmenu(MainWindow) > tkconfigure(MainWindow,menu=topMenu) > normalizeMenu <- tkmenu(topMenu, tearoff=FALSE) > tkadd(normalizeMenu,"command",label="Normalize",command = > function() NormalizeNow(MainWindow)) > tkadd(topMenu, "cascade", label="MainWindow", menu = normalizeMenu) > tkfocus(MainWindow) > # > }#end of testGUI <- function() > # > NormalizeNow <- function(MainWindow){ > NMethod <- GetNMethod(MainWindow) > if (NMethod=="") return() > tkconfigure(MainWindow,cursor="watch") > tkfocus(MainWindow) > }#end of NormalizeNow <- function(){ > # > GetNMethod <- function(MainWindow){ > ReturnVal <- "RMA" > GNMethod <- tktoplevel(MainWindow) > tkwm.deiconify(GNMethod) > tkgrab.set(GNMethod) > tkfocus(GNMethod) > tkwm.title(GNMethod,"Get Method") > tkbind(GNMethod,"<Destroy>",function() {ReturnVal <- > "";tkgrab.release(GNMethod);tkfocus(MainWindow);}) > tkwait.window(GNMethod) > return (ReturnVal) > }#end of GetNMethod <- function() > > > and then run the function testGUI() > > A Main Window pops up with "Main Window" in the Menu bar. Click on > "Main Window" and the first (and only) item on the menu drops down and > it is called "Normalize". Clicking this opens another windows entitled > "Get Method". If there is a problem (it is intermittent), it is > evidenced by the fact that the "Get Method" window will not close. > > It cannot be closed by clicking. The window is frozen open. It can be > moved but not closed. On MS Windows, the "Get Method" window can be > closed using the right button close window option on the task bar > icon Typically the problem occurs infrequently in the first 10 > presses on the "Normalize" item, but more frequently there after. > > I have NOT had the problem on Mac OSX or Linux. > > On MS Windows (I have tested on Win XP-32bit and Win7-64bit) the > problem occurs in R-2.16.0, R-2.15.2, R-2.15.1,R-2.14.0. > > THERE IS NO PROBLEM WITH R-2.13.1 and R-2.13.0 > > I have run it using debug("GetNMethod"). Stepping through the > GetNMethod function results in freezing when asked to do the > "tkgrab.set(GNMethod)" instruction. > > I would appreciate if others can confirm similar behaviour. > > Can anyone suggest why it worked under R-2.13.x but not in later > versions of R. > > Was there a change in R that impacts with this aspect of tcltk? > > Is there a work around for this problem? > > Any suggestions appreciated, > > thanks > > Keith Satterley > affylmGUI, limmaGUI maintainer. > Bioinformatics Division > The Walter and Eliza Hall Institute > Melbourne, Australia. > > Some sessionInfo() outputs: > > > > Win7-64bit-R-2.15.2 testGUI() fails intermittently. > > sessionInfo() > R version 2.15.2 (2012-10-26) > Platform: x86_64-w64-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=C > [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C > [5] LC_TIME=English_Australia.1252 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets > methods base > > > > Linux x64-R-2.15.2. testGUI() works always > R version 2.15.2 (2012-10-26) > Platform: x86_64-unknown-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets methods > [8] base > > > > Mac OS X R-2.15.2. testGUI() works always > > sessionInfo() > R version 2.15.2 (2012-10-26) > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) > > locale: > [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets > methods base > > > > WinXP-32bit--R-2.15.2. testGUI() fails intermittently > > sessionInfo() > R version 2.15.2 (2012-10-26) > Platform: i386-w64-mingw32/i386 (32-bit) > > locale: > [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 > LC_MONETARY=English_Australia.1252 LC_NUMERIC=C > [5] LC_TIME=English_Australia.1252 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets > methods base > > > > Win7-R-2.13.1. testGUI() works always > > sessionInfo() > R version 2.13.1 (2011-07-08) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=C > [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C > [5] LC_TIME=English_Australia.1252 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets > methods base > > > > > ______________________________________________________________________ > The information in this email is confidential and inte...{{dropped:22}}
I see the freeze that you mentioned. I'm not likely to be able to track this down in the next while, so I'd suggest posting it to the R bug list. (If you can determine what makes it 100% reproducible, or shorten the script even more, that will make it easier to find and fix.) Duncan Murdoch On 12-11-19 12:05 AM, Keith wrote:> I am the maintainer of a Bioconductor package (affylmGUI) which uses > tcltk. It freezes inconsistently on MS Windows, but not Mac or Unix. see > details below. > > After considerable testing I have reduced the problem from a few > thousand lines of code to 30 lines! > > If you paste the following lines of code into an R window: > > > testGUI <- function(){ > require(tcltk) > MainWindow <- tktoplevel() > topMenu <- tkmenu(MainWindow) > tkconfigure(MainWindow,menu=topMenu) > normalizeMenu <- tkmenu(topMenu, tearoff=FALSE) > tkadd(normalizeMenu,"command",label="Normalize",command > function() NormalizeNow(MainWindow)) > tkadd(topMenu, "cascade", label="MainWindow", menu = normalizeMenu) > tkfocus(MainWindow) > # > }#end of testGUI <- function() > # > NormalizeNow <- function(MainWindow){ > NMethod <- GetNMethod(MainWindow) > if (NMethod=="") return() > tkconfigure(MainWindow,cursor="watch") > tkfocus(MainWindow) > }#end of NormalizeNow <- function(){ > # > GetNMethod <- function(MainWindow){ > ReturnVal <- "RMA" > GNMethod <- tktoplevel(MainWindow) > tkwm.deiconify(GNMethod) > tkgrab.set(GNMethod) > tkfocus(GNMethod) > tkwm.title(GNMethod,"Get Method") > tkbind(GNMethod,"<Destroy>",function() {ReturnVal <- > "";tkgrab.release(GNMethod);tkfocus(MainWindow);}) > tkwait.window(GNMethod) > return (ReturnVal) > }#end of GetNMethod <- function() > > > and then run the function testGUI() > > A Main Window pops up with "Main Window" in the Menu bar. Click on "Main > Window" and the first (and only) item on the menu drops down and it is > called "Normalize". Clicking this opens another windows entitled "Get > Method". If there is a problem (it is intermittent), it is evidenced by > the fact that the "Get Method" window will not close. > > It cannot be closed by clicking. The window is frozen open. It can be > moved but not closed. On MS Windows, the "Get Method" window can be > closed using the right button close window option on the task bar icon > Typically the problem occurs infrequently in the first 10 presses on the > "Normalize" item, but more frequently there after. > > I have NOT had the problem on Mac OSX or Linux. > > On MS Windows (I have tested on Win XP-32bit and Win7-64bit) the problem > occurs in R-2.16.0, R-2.15.2, R-2.15.1,R-2.14.0. > > THERE IS NO PROBLEM WITH R-2.13.1 and R-2.13.0 > > I have run it using debug("GetNMethod"). Stepping through the GetNMethod > function results in freezing when asked to do the "tkgrab.set(GNMethod)" > instruction. > > I would appreciate if others can confirm similar behaviour. > > Can anyone suggest why it worked under R-2.13.x but not in later > versions of R. > > Was there a change in R that impacts with this aspect of tcltk? > > Is there a work around for this problem? > > Any suggestions appreciated, > > thanks > > Keith Satterley > affylmGUI, limmaGUI maintainer. > Bioinformatics Division > The Walter and Eliza Hall Institute > Melbourne, Australia. > > Some sessionInfo() outputs: > > > > Win7-64bit-R-2.15.2 testGUI() fails intermittently. > > sessionInfo() > R version 2.15.2 (2012-10-26) > Platform: x86_64-w64-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=C > [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C > [5] LC_TIME=English_Australia.1252 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets methods > base > > > > Linux x64-R-2.15.2. testGUI() works always > R version 2.15.2 (2012-10-26) > Platform: x86_64-unknown-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets methods > [8] base > > > > Mac OS X R-2.15.2. testGUI() works always > > sessionInfo() > R version 2.15.2 (2012-10-26) > Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) > > locale: > [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets methods > base > > > > WinXP-32bit--R-2.15.2. testGUI() fails intermittently > > sessionInfo() > R version 2.15.2 (2012-10-26) > Platform: i386-w64-mingw32/i386 (32-bit) > > locale: > [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 > LC_MONETARY=English_Australia.1252 LC_NUMERIC=C > [5] LC_TIME=English_Australia.1252 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets > methods base > > > > Win7-R-2.13.1. testGUI() works always > > sessionInfo() > R version 2.13.1 (2011-07-08) > Platform: x86_64-pc-mingw32/x64 (64-bit) > > locale: > [1] LC_COLLATE=English_Australia.1252 LC_CTYPE=C > [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C > [5] LC_TIME=English_Australia.1252 > > attached base packages: > [1] tcltk stats graphics grDevices utils datasets methods > base > > > > > ______________________________________________________________________ > The information in this email is confidential and intend...{{dropped:4}} > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
On 19/11/2012 12:05 AM, Keith wrote:> ...> A Main Window pops up with "Main Window" in the Menu bar. Click on "Main > Window" and the first (and only) item on the menu drops down and it is > called "Normalize". Clicking this opens another windows entitled "Get > Method". If there is a problem (it is intermittent), it is evidenced by > the fact that the "Get Method" window will not close. > > It cannot be closed by clicking. The window is frozen open. It can be > moved but not closed. On MS Windows, the "Get Method" window can be > closed using the right button close window option on the task bar icon > Typically the problem occurs infrequently in the first 10 presses on the > "Normalize" item, but more frequently there after. > > I have NOT had the problem on Mac OSX or Linux. > > On MS Windows (I have tested on Win XP-32bit and Win7-64bit) the problem > occurs in R-2.16.0, R-2.15.2, R-2.15.1,R-2.14.0. > > THERE IS NO PROBLEM WITH R-2.13.1 and R-2.13.0 > > I have run it using debug("GetNMethod"). Stepping through the GetNMethod > function results in freezing when asked to do the "tkgrab.set(GNMethod)" > instruction. > > I would appreciate if others can confirm similar behaviour.b > > Can anyone suggest why it worked under R-2.13.x but not in later > versions of R. > > Was there a change in R that impacts with this aspect of tcltk? > > Is there a work around for this problem?If all you are interested in is closing the Window, it seems on my Windows 7 system that right clicking the corresponding button in the task bar at the bottom of the screen to bring up the local menu, and choosing "close", will successfully close it. Of course, this doesn't address the real problem. Duncan Murdoch
On 19/11/2012 12:05 AM, Keith wrote: ...> On MS Windows (I have tested on Win XP-32bit and Win7-64bit) the problem > occurs in R-2.16.0, R-2.15.2, R-2.15.1,R-2.14.0. >Of course, there is no 2.16.0 yet, but one more datapoint: I can't reproduce the problem with a current build of R-devel (i.e. the one that reports itself as 2012-11-19 r61131. What version were you trying? Duncan Murdoch
R Version 2.15.0/Windows XP Maybe this will help to identify the problem (I have similar problems with other tcltk-windows, too.) Inserting some time delay after tktoplevel helps (on my PC):> test2GUI <- function(){ > require(tcltk) > MainWindow <- tktoplevel()Sys.sleep(0.1)> topMenu <- tkmenu(MainWindow) > tkconfigure(MainWindow,menu=topMenu) > tkgrab.set(MainWindow) > tkfocus(MainWindow) >}Cheers Andreas Andreas M?ltner
Andreas, thanks so much for this clue. I have found that if I reduced the time in seconds from 0.1 to 0.01 to 0.001 to 0.0001 I only had problems with freezing on the 0.0001 time. I tested on Win7(64 bit) on an Intel core i7 870 at 2.93GHz (16GB ram)(8 cores) and a WinXP (32bit) Pentium 4 3.01GHz (2GB ram) using R-2.15.2(2012-10-26) on both. I had previously found that the tkgrab.set command seemed to be the one actually freezing so I placed the sleep command just before that with the same result as it being just after the tktoplevel command. I am now going to try it in my packages affylmGUI and limmaGUI, probably with a sleep time of 0.1 to be on the safe side, many thanks, Keith Satterley On 18/12/2012 9:38 PM, Moeltner, Andreas wrote:> R Version 2.15.0/Windows XP > > Maybe this will help to identify the problem (I have similar problems with other tcltk-windows, too.) > > Inserting some time delay after tktoplevel helps (on my PC): > >> test2GUI <- function(){ >> require(tcltk) >> MainWindow <- tktoplevel() > Sys.sleep(0.1) >> topMenu <- tkmenu(MainWindow) >> tkconfigure(MainWindow,menu=topMenu) >> tkgrab.set(MainWindow) >> tkfocus(MainWindow) >> } > Cheers > Andreas > > > Andreas M?ltner______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}