Displaying 20 results from an estimated 32 matches for "tkfocus".
Did you mean:
focus
2009 Apr 14
0
disappearing dialog boxes when using tcltk
...=================
## Add Dialog Box (with only "OK" button)
##===============================================
modalDialogOK <-
function(title,question,entryInit,entryWidth=10)
{
returnValOnCancel="ID_CANCEL"
dlg <- tktoplevel()
tkwm.deiconify(dlg)
tkgrab.set(dlg)
tkfocus(dlg)
tkwm.title(dlg,title)
textEntryVarTcl <- tclVar(paste(entryInit))
textEntryWidget <-
tkentry(dlg,width=paste(entryWidth),textvariable=textEntryVarTcl)
tkgrid(tklabel(dlg,text=" "))
tkgrid(tklabel(dlg,text=question),textEntryWidget)
tkgrid(tklabel(dlg,text=&quo...
2003 Jun 06
4
stuck tcltk scrollbars under Windows XP
Dear R-devel list members,
I've encountered a problem with my Rcmdr package under Windows XP and could
use some advice:
The Rcmdr package uses the tcltk package to create menus and dialog boxes.
My standard procedure when a dialog is created is to grab the focus -- e.g., by
tkfocus(top)
tkgrab(top)
(Here, top is a top-level window -- say, containing one or more
scrollbars.) When the window is closed, I release the focus, destroy the
window, and return the focus to another window -- e.g.,
tkgrab.release(top)
tkdestroy(top)
. . .
tkfocus(.commander)...
2006 Feb 10
0
tk mouse cursor icon widget tkwinfo tkfocus questions
...uessing this is a string directly returned from tcl.
Is there a way to turn this into a list of widgets after some parsing?
Right now I'm using a hardcoded list for widglist, but if I or others
change the layout, the coding gets messy.
2. How do I specify the force option with tkfocus? Or, more generally,
any option in a tk function that doesn't take a value?
I can see the force option is available from the errors at my
failed attempts to specify it. MS keeps popping up my Tk
window behind another window.
Thanks for any help.
-Frank
2007 Jul 11
0
tkfocus issue
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
2008 Jul 18
0
Retrieving data from a tcl /tk function
...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)
tkgrab.set(dlg)
tkfocus(dlg)
tkwm.title(dlg, title)
textEntryVarTcl <- tclVar(paste(entryInit))
textEntryWidget <- tkentry(dlg, width = paste(entryWidth),
textvariable = textEntryVarTcl)
tkgrid(tklabel(dlg, text = " "))
tkgrid(tklabel(dlg, text = question), textEntryWidget...
2012 Nov 19
6
tcltk freezing using MS Windows for R-2.14+
...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(){
#...
2009 Oct 19
1
Problem with geometry manager in TclTK
...39; for width and height.
Provided below is quite detailed code, containing pretty much my entire
functions, except the parts not related to TclTk.
Thank you in advance,
Gabriel Margarido.
CODE:
library(tcltk)
ask.format <- function() {
ask.form <- tktoplevel()
tkgrab.set(ask.form)
tkfocus(ask.form)
tkwm.title(ask.form,"Input Format")
tkwm.resizable(ask.form, 0, 0)
file.format <- tclVar("1")
ReturnFormat <- "ID_CANCEL"
Title.frame <- tkframe(ask.form, relief="groove")
tkgrid(tklabel(Title.frame,text="Input File Forma...
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 the tcltk package
> require(tcltk)
Loading required package: tcltk
[1] TRUE
>
> # Create a new toplevel wi...
2012 Feb 24
1
tcl tk command function with arguments ??
...ike 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 arguments and its use in
"tkbutton(tt,text="OK",command=PressedOK)" is without any brackets.
Unfortunately I would like to use several buttons and therefor define the
corresponding functions to it.
For example
require(tcltk)
OK.but <- NUL...
2009 Jul 09
1
Changing text in a tkentry widget
...t;Anonymous")
entry.Name <-tkentry(tt,width="20",textvariable=Name)
tkgrid(entry.Name)
OnChange <- function()
{
assign("Name",tclVar("changed name"),thisEnv)
}
Change.but <-tkbutton(tt,text=" Change ",command=OnChange)
tkgrid(Change.but)
tkfocus(tt)
##################
(much of this is taken from
http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/editboxes.html)
Now, I thought the whole point of the textvariable argument was to
change the content of the tkentry widget. But, as you can see by running
this code, changing the Name variab...
2003 Nov 03
0
problem with fix() called from Rcmdr
...button executes the
following code:
onEdit <- function(){
command <- paste("fix(", .activeDataSet, ")", sep="")
logger(command)
justDoIt(command)
activeDataSet(.activeDataSet)
tkwm.deiconify(.commander)
tkfocus(.commander)
}
where .activeDataSet is a (global) character variable containing the name
of the "active" data frame, logger() just echoes the command to the R console
logger <- function(command){
if (tclvalue(.logCommands) == "1") {
tkinsert(.log, &qu...
2008 Mar 19
1
Radio Buttons or similars
...age="Good choice! Oranges are full of Vitamin C!")
print(rbVal);
return(rbVal);
}
OK.but <- tkbutton(tt,text="OK",command=function() aux_function())
#OK.but <- tkbutton(tt,text="OK",command=function() value<<-aux_function())
tkgrid(OK.but)
tkfocus(tt)
#return(value)
}
Thanks in advance!
A greetings Luismi
--
View this message in context: http://www.nabble.com/Radio-Buttons-or-similars-tp16164495p16164495.html
Sent from the R help mailing list archive at Nabble.com.
2005 Mar 16
0
X11 Protocol error : BadWindow
...k-shlibs 8.4.1-12
Tool Command Language and the Tk toolkit
#### R CODE
PressedOK <- function()
{
plot(runif(100)*10,runif(100)*10)
}
tt <- tktoplevel()
OK.but <- tkbutton(tt,text="OK",command=PressedOK)
tkgrid(OK.but)
tkfocus(tt)
If I evaluate the above code, it works as expected. However, when
completed (I close the "OK" window), if I enter any commands that
result in errors by R (commands that don't exist, for example), I get:
> dev()
Error: couldn't find function "dev"
In additio...
2005 Aug 31
1
tcl/tk return problem
...level()
tkgrid(tklabel(tt,text="Choose a directory!"))
OnOK <- function()
{
fileDir<-tclvalue(tkchooseDirectory())
data.raw <- ReadAffy(celfile.path=fileDir)
#return(data.raw)
}
OK.but <- tkbutton(tt,text="OK",command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
}
So after clicking on my "OK" button, I choose my directory and read the
cel-files.
But now I want to return the object to my workspace ... "return" doesn't
work here.
Could anyone give me a hint?
Thank you very much,
Daniela
2006 Mar 02
0
tcltk error when calling a dialog
...Dialog1 <- function/()/ {
mddlg2 <- /tktoplevel()/
tkwm./deiconify(/mddlg2/)/
tkgrab./set(/mddlg2/)/
tkwm./title(/mddlg2,"Plot options"/)/
onNO <- function/()/
{
tkgrab./release(/mddlg2/)/
/tkdestroy(/mddlg2/)/
/tkfocus(/dlg/)/
}
// NO.but <- /tkbutton(/mddlg2,text=" Cancel ",command=onNO/)/
/tkgrid(/NO.but,pady=2/)/
/tkfocus(/mddlg2/)/
tkwait./window(/mddlg2/)/
}
Please for those who are used to utilize the tcltk library: ¿Can you see a clear error in this?
I'...
2007 May 13
1
Dropdown boxes in tcltk and R
...omboBox)
OnOK <- function()
{
tkdestroy(tt)
msg <- paste("Good choice! ",fruitChoice,"s are delicious!",sep="")
tkmessageBox(title="Fruit Choice",message=msg)
}
OK.but <-tkbutton(tt,text=" OK ",command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
tkwait.window(tt)
fruitChoice <- fruits[as.numeric(tclvalue(tcl(comboBox,"getvalue")))+1]
fruitChoice
Which gives me:
Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"),
class = "tclObj") :
[tcl] invalid command name &quo...
2008 Aug 19
1
Open directory within a menu in tcltk
...l="Open file", command=openfile)
tkadd(plotMenu, "command",label="Select directory",command=opendir)
tkadd(plotMenu,"command",label="Quit", command=function() tkdestroy(t1))
tkadd(topMenu, "cascade", label="Menu",menu=plotMenu)
tkfocus(t1)
I can extract a file, but not a directory, I obtain the following error message:
Error in function ():
cannot change value of locked binding for 'dirname'.
I would appreciate very much any help or explanation on this.
As always, thank you,
Judith
2010 Jul 21
1
tcltk resizing when using tkgrid for layout
...(yscr,...),
wrap="none")
tkgrid(txt,yscr)
tkgrid(xscr)
tkgrid.configure(yscr,sticky="ns")
tkgrid.configure(xscr,sticky="ew")
for (i in (1:100)) tkinsert(txt,"end",paste(i,"^ 2 =",i*i,", "))
tkconfigure(txt, state="disabled")
tkfocus(txt)
This creates a scrollable text window, and it suffers from exactly the
problem I described above. My question is: what needs to be changed in
order to make the tktext widget and its scrollbars automatically resize
with the parent window?
Thank you.
[[alternative HTML version deleted]]
2004 Apr 14
1
Passing a pointer to .C() in Win32
...sts it as a pointer in order to call the real
SetForegroundWindow function?
Of course environments behave like pointers but they are
read-only. You can't do this (below), right?
mode(hWnd) <- "environment"
WHY WOULD I WANT TO DO ANYTHING LIKE THIS ABOVE?
I know that I can use tkfocus for Tk windows, but I have other
applications in mind. In Win32, when I run RGui with MDI, the
bringToTop in tcltk's .onLoad brings the console to the top, but
doesn't focus it, i.e. after library(tcltk), I can't type into
the console until I click on it. Now if I had RConsole->...
2009 Sep 28
2
re trieve user input from an tcl/tk interface
...# I want to suggest default values but they
should be editable.
entry.Stimuli = tkentry(tt, width = "3", textvariable = Stimuli)
tkgrid(tklabel(tt, text = "Number of stimuli:"))
tkgrid(entry.Stimuli)
OK.but = tkbutton(tt,text=" Go! ",command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
-------------------------------------------------------------
Of course, I also tried to find a solution via google but couldn't really
find anything. http://tolstoy.newcastle.edu.au/R/e4/help/08/07/17422.html
The only thing I found was this post which never got answered . I hope
someone...