Displaying 20 results from an estimated 4000 matches similar to: "R Tcl/Tk [MacOSX] TkButton Problem"
2012 Feb 24
1
tcl tk command function with arguments ??
Hello, I am using R 2.11.1 under Windows XP.
I would like to know if its possible to use a function with arguments as a
command in tcl tk. For example
require(tcltk)
PressedOK <- function()
{
tkmessageBox(message="You pressed OK!")
}
tt <- tktoplevel()
OK.but <- tkbutton(tt,text="OK",command=PressedOK)
tkgrid(OK.but)
tkfocus(tt)
the function PressedOK has no
2001 Feb 03
1
callback environment for Tk buttons
Hi. I'm running into problems with using R functions as callback
commands for buttons in Tk.
The following Tcl/Tk script creates three buttons. If you press hello
it prints hello world. If you press HALLO it prints HALLO WORLD.
Not exciting, but I need an example...
set tt [toplevel .tt]
foreach i {"hello" "HALLO"} {
pack [button $tt.b$i -text $i
2002 May 29
2
Tcl/tk , question about the environment of the call
This is my simple code, my intention is to let the inner function browse the
objects in the outer function.
#######################
tk1 <- function() {
tk2 <- function() {
inner <- 3
list2 <- ls()
#list objects in fuction tk2
print("**** inner objects ****")
print(list2)
#list objects in fuction tk1
list_parent <- ls(parent.frame())
2012 Jul 16
2
Tk grid problem
Hi everybody,
I have a problem with the grid function in tk.
I juste try to put 4 buttons like this:
-------------------
| | |
| | C |
| A |--------|
| | |
---------- D |
| | |
| B | |
-------------------
A is 2x2
C is 1x2
B is 1x2
D is 2x2
but the code bellow dont work :
require(tcltk)
tt <-
2005 Aug 31
1
tcl/tk return problem
Hello,
I'm very new in working with tcl/tk in R and have a problem which will
probably
sound silly to most of you.
Here is the code I have problems with:
readcelfiles <- function()
{
require(tcltk)
tt <- tktoplevel()
tkgrid(tklabel(tt,text="Choose a directory!"))
OnOK <- function()
{
fileDir<-tclvalue(tkchooseDirectory())
data.raw <-
2009 Sep 28
2
re trieve user input from an tcl/tk interface
Hello everyone,
this is my first post here and I hope I signed up correctly and someone will
take me by the hand and help me out. I am new to R and cannot figure out
what to do here...
... I want to have an User Interface that requests input. I want to save
this input to a variable to use it later on. I was able to do this with a
modalDiaglog (
2008 Jul 18
0
Retrieving data from a tcl /tk function
Hello,
I am sorry if this is an answered question, but I did my homework for a long while and couldn't figure out a way to retrieve data entry from a model dialog. In one of the examples compiled by James Wettenhall:
odalDialog <- function(title, question, entryInit, entryWidth = 20,
returnValOnCancel = "ID_CANCEL") {
dlg <- tktoplevel()
tkwm.deiconify(dlg)
2005 Jun 04
2
locator() via tcltk
Hello,
I'm trying to write a function using tcltk to interactively modify a plot
and gather locator() data. I've read Peter's articles in Rnews, the help
pages in tcltk, http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/,
plus a post in R-help sometime ago, but haven't found a solution.
The idea goes something like this:
require(tcltk)
testplot <- function() {
getcoords
2008 Aug 11
3
tkentry that exits after RETURN?
I can set up an entry widget (thanks to an old
post by Barry Rowlingson) that gets a password and
exits when the user clicks on the "OK" button.
Anyone have any clever ideas for returning/
destroying the window when the user types a carriage
return/ENTER in the text window? I've messed around
a little with validate, validatecommand, but don't
see any obvious way to do it ...
2003 Jan 20
1
curious code mistakes
hi,
know anybody why this happen ?
I''m using winedt , the old code saved in an .R
call syntax error''s. Curious is, when i''m type below
the same code , it works ???
...imho a print type problem, what i''m never before observed and
can''t recognize with my eyes ?
P.S. R.1.6.1 /w2k
thanks for advance
& regards,christian
>>getfile <-
2009 Oct 19
1
Problem with geometry manager in TclTK
Hello, everyone.
I have the following problem with TclTk: I create some windows and want to
change their position with geometry manage (sometimes they will be centered,
sometimes not).
If the toplevel is created and its dimensions are gathered via 'tkwinfo', I
get (usually) correct values. However, if this window is created by a
function (in the following example, by 'ask.format')
2003 Jan 20
0
Tcl/Tk and mouse
Within a loop I tried to draw some things in
dependency on the position of the mouse.
This works fine with R-1.5.1 but R-1.6.1
requires to include some delay by
Sys.sleep(delay) with delay>=0.015.
For smaller values (e.g. 0.0001) the
top level tcltk-window does not appear
and so I am not able to control the elements
to be plotted using the tcltk-widget.
Question1: How can I force
2008 Mar 19
1
Radio Buttons or similars
Hello companions!!!
I have a function that creates a Radio Buttons, and I need that this
function return the selected value in the Radio Buttons. I would like that,
if somebody know as I could return the value, you say me as do it.
Next, I show the function
function1<-function(){
require(tcltk)
tt <- tktoplevel()
rb1 <- tkradiobutton(tt)
rb2 <- tkradiobutton(tt)
rbValue <-
2003 Sep 08
1
add checkbutton and the variable(wrong length of vector "b")
Hello it wanted to add a boton of checkup in a menu, ?How I do to create so
many variables as checkbutton? I try with the code that continues, use a
vector that is charged dynamicamente while I open files but the component
of vector "b" is associates with a Tcl variable and load 3 components
(environment, value and pointer) I wanted alone to charge the value (0 done
not select
2000 Sep 29
1
Two tcltk questions and Re: tcltk package functionality
Sorry, for my mail from last night contains no subject.
Therefore, I send it again and two tcltk questions are appended.
----------------------------------------------------------------------------
Prasad wrote:
> I wrote a function in R which uses tcltk package .... essentially I wanted
> to give within that function, a widget with 2 radiobuttons to choose
> between plotting Precip
2002 Sep 26
3
tcltk - command=function()
hi,
just having the idea create a simple
tcl/tk gui-dialog for different data-file formats
i get starting problems and it would be nice
get some tips/tricks from experienced tcl/tk user in R !
tt <- tktoplevel()
label.widget <- tklabel(tt,text="Decision Tree GUI")
button.widget <- tkbutton(tt,text="Select SPSSFile",
command=function()
2007 Sep 19
1
Running tcltk From a batch file
Hi,
I am trying to run some simple tktcl code....
## in a file called test.R
require(tcltk)
tt <- tktoplevel()
OK.but <- tkbutton(tt,text="OK",command=function()tkdestroy(tt))
tkgrid(OK.but)
tkfocus(tt)
Using a batch file with the command
Rterm < test.R > testOutput.Rout --slave
The GUI pops up but then disappears. The results in the test.Output.Routfile are
> # Load
2005 Jul 12
1
help: how to use tkevent.generate(...)
Hello,
I use package "tcltk" to do some GUI programming, and want to find a
function which can do the operation "click a button", just like using
a mouse to click. If tkevent.generate can do that? I tried it as
below, but failed. Please give me a hint!
tt <- tktoplevel()
tkwm.title(tt,"Simple Dialog")
onOK <- function(){print("OK")}
onCancel <-
2003 Apr 17
2
BATCH and tcltk
Hi R-hackers
I try to write a batch (in Windows, i have to use!) with
Rcmd BATCH D:\Test.R D:\Test.Rout and
Rterm.exe --no-restore --no-save < D:\Test.R > D:\Test.Rout.
In my file Test.R are any tk-codelines (like: Window1 <- tktoplevel(); ... tkbutton...).
It works not interactifly, what is written in Rcmd BATCH --help.
Exist there a way to do it all the same?
Please help...
2011 Nov 07
1
tcltk window freezes when using locator( )
Hello useRs
Using the following code:
library(tcltk)
win<-tktoplevel()
ff<-function(){
plot(1:10,1:10)
pol<-locator(1)
print(pol)
}
button<-tkbutton(win,text="test",command=ff)
tkpack(button)
makes the win panel stop responding when the plot is closed before choosing a location. Usually, the windows task manager
has to be used to