Using stylo GUI on my Mac

307 views
Skip to first unread message

Aurélien Berra

unread,
May 20, 2017, 6:49:43 PM5/20/17
to computationalstylistics
Dear stylists,

I attended Mike's introduction to stylo this week in Paris. I had played a bit with stylo before, and everything seemed to be working as expected on my machine (a Mac, see details below) until then. However, on the day of the workshop, I was unable to start the GUI, although the package was (and still is) functioning normally with R code and the `gui = FALSE` option.

The package is loaded, but after the message "using current directory..." has been displayed the R session hangs both in the R console and in RStudio when I try `stylo()`, `oppose()` or any other command requiring the GUI to be launched. The only error message I ever got was the following, when I tried to use stylo via the terminal:

```
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
  [tcl] named font "myDefaultFont" already exists.
```

I got the same result with the `debug` function:

```
> debug(stylo)
> stylo()
[…]
debug: .Tcl("font create myDefaultFont -family tahoma -size 8")
Browse[3]>
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
  [tcl] named font "myDefaultFont" already exists.
```

So, the problem seems to have to do with Tcl/Tk and the font used (I haven't seen any bug apart from the stylo GUI not starting). How can I test that, for example by manually setting the font?

At the workshop, another Mac user with a similar configuration was able to use the GUI. I also tried on another Mac (with the same setup except less applications are installed, but I don't see any relevant difference) and could not reproduce the bug: the GUI appears and stylo does its job.

I did all the updates I can think of and re-installed XQuartz, stylo, Rstudio, and R itself – to no avail. You are my only hope! What else could I try? Any help or hint will be most welcome.

Best wishes (and thanks for your wonderful work, of course),

Aurélien



## Configuration details

XQuartz 2.7.11 (xorg-server 1.18.4)

RStudio Version 1.0.143

tcl: 8.6.4.1.299124

> library(stylo)
stylo version: 0.6.4

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] stylo_0.6.4

loaded via a namespace (and not attached):
 [1] lattice_0.20-35 ape_4.1         tcltk2_1.2-11   class_7.3-14    grid_3.4.0      tsne_0.1-3      nlme_3.1-131    e1071_1.6-8     Matrix_1.2-10  
[10] splines_3.4.0   tools_3.4.0     pamr_1.55       survival_2.41-3 parallel_3.4.0  compiler_3.4.0  cluster_2.0.6   tcltk_3.4.0     knitr_1.16 

Maciej Eder

unread,
May 21, 2017, 8:25:32 AM5/21/17
to computationalstylistics
Dear Aurélien,

the problem you observe is not directly related to stylo. Rather, it suggests that something (or someone) terminated computing when the machine was not done with the GUI instructions. (Far too many possible factors that might have caused it.) Whatever it was, however, it stopped the execution when a font was declared and not cleaned up afterwards. The next run of stylo (and its GUI) bumped into the already declared font and was stuck.

The easiest way to neutralise the problem is to re-launch R (or RStudio). The neatest solution, however, is to clean up the declared font by typing:

.Tcl("font delete myDefaultFont")


Some systems require that the tcltk2 library is activated before the .Tcl() function is run:

library(tcltk2)


That's it I guess. Frankly, I should think one day of adding a sanity check, so that the default font is not declared if it already exists in the Tcltk namespace -- if only I had more time to add all those new functionalities!

All the best,
maciej

Aurélien Berra

unread,
May 21, 2017, 4:26:47 PM5/21/17
to computationalstylistics
Dear Maciej,

Thanks for your suggestion. The command seems to be just what I need – unfortunately, it apparently has no effect. I get this message:

Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
  [tcl] named font "myDefaultFont" doesn't exist.

and stylo() hangs without any noticeable difference.

Is there anything else I could test?

Best wishes,

Aurélien
Reply all
Reply to author
Forward
0 new messages