Re: [R] tcltk problem with Button-2

2003-11-30 Thread Peter Dalgaard
Gabor Grothendieck [EMAIL PROTECTED] writes:

 But if I simply replace Control-Button-1 with Button-2 in the tkbind
 command, i.e. the last line, then nothing happens when I press 
 Button-2 (which I assume is the right mouse button).

It's the middle button (Tk was designed for three-button mice). The
right button is Button-3.

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] tcltk problem with Button-2

2003-11-29 Thread Gabor Grothendieck


The following R code works as expected:

require( tcltk )
tt - tktoplevel()

# create a button labelled A that changes to B when pressed
pressed - function() tkconfigure( tt.but, text=B )
tt.but - tkbutton( tt, text=A, command=pressed )
tkpack(tt.but)

# if Control-Button-1 pressed change button label to C
e - expression( tkconfigure( tt.but, text=C ), break )
tkbind(tt.but, Control-Button-1, e )

But if I simply replace Control-Button-1 with Button-2 in the tkbind
command, i.e. the last line, then nothing happens when I press 
Button-2 (which I assume is the right mouse button).

I also tried removing the break and using a function instead of an
expression but it also does not respond, i.e. I tried replacing
the last line with:

tkbind(tt.but, Button-2, function() tkconfigure( tt.but, text=C ) ) 

I am using Windows 2000 and R 1.8.1 and am pasting the script 
into Rterm to make sure that the Rgui does not interfere with it.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help