Displaying 20 results from an estimated 170 matches for "tktoplevel".
2007 May 24
1
GUI component Margin on tkcanvas, tkframe or tktoplevel
Dear gurus:
I have a question on how to configure the margin layout on tcl/tk GUI
objects like tkcanvas, tkframe or tktoplevel.
For example, if I want to leave a larger margin on the left side of the
GUI container, which one should I configure, the toplevel or tkcanvas or
tkframe?
top<-tktoplevel()
canvas<-tkcanvas(top, relief=, borderwidth=...)
I also find the documentation for all the possible arguments that co...
2006 Aug 25
0
tktoplevel & tkgetSaveFile options
Dear list,
Previously I posted these question to R-SIG-GUI. Perhaps here is a better place.
1. Is there some option for mantaining the tktoplevel window always on top?
2. Is there some option to eliminate the border icons maximize, minimize and close of a tktoplevel window?
3. Is possible to avoid the warning message (or changing its contents) in tkgetSaveFile when the file to save already exists?
Thanks,
Manel
2006 Jul 11
1
Linux/MacOSX and "X11 protocol error: BadWindow..." warnings
...ast John Fox in
the Rcmdr package) to make special moves to catch the
warnings and hide them from users.
In an effort to pin it down, outside of Rcmdr or any
packages other than tcltk itself, I came up with a simple
reproducible example. Essentially, the sequence that gives
the warnings is
tktoplevel()
[then close the Tk window using the window controls]
X11()
tktoplevel()
[then close the Tk window using the wondow controls]
Closing the second Tk window is the act that seems to
provoke the warnings (see the two session transcripts
below). The number of warnings is different on my two
s...
2003 May 06
4
bitmap images in tcltk
...kage using tcltk. Thanks to Peter Dalgaard's excellent
work on the tcltk package, almost everything has gone very smoothly. I'm
stymied, however, by the following problem:
I want to incorporate a bitmap image, stored as an xbm file, in a widget.
To take a simple example,
top <- tktoplevel()
tkgrid(tklabel(top, bitmap="@file.xbm", fg="red"))
will work as long as file.xbm is in the current directory; alternatively, I
could specify the path to this file. The problem is that I can't figure out
a reliable way of predicting (or discovering) where the bitmap...
2008 Aug 11
3
tkentry that exits after RETURN?
...e 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 ...
getPassword <- function(){
require(tcltk)
tt <- tktoplevel()
pass=tclVar("")
label.widget <- tklabel(tt, text="Enter Password")
password.widget <- tkentry(tt,show="*",textvariable=pass)
ok <- tkbutton(tt,text="OK",default="active",
command=function()tkdestroy(tt))...
2003 Mar 27
0
R TclTk iwidgets::combobox
Thanks Peter,
I've started a new R session (in Windows) and managed to get
both ways working now :
### THIS WORKS !!! ###
library(tcltk)
tclRequire("IWidgets")
tt<-tktoplevel()
combo <- tkwidget(tt,"iwidgets::combobox")
tkpack(combo)
### AND THIS WORKS TOO !!! ###
tt<-tktoplevel()
win <- .Tk.subwin(tt)
.Tcl(paste("iwidgets::combobox",.Tk.ID(win),.Tcl.args()))
tkpack(win)
But they both fail in my old R session - maybe I've tclRequired...
2009 Apr 14
0
disappearing dialog boxes when using tcltk
...lions of thanks!
Hua
##===============================================
## 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=quest...
2001 Feb 03
1
callback environment for Tk buttons
...e...
set tt [toplevel .tt]
foreach i {"hello" "HALLO"} {
pack [button $tt.b$i -text $i -command "puts $i"] -fill x
}
pack [button $tt.dismiss -text dismiss -command "destroy $tt"] -fill x
If I translate this to R, I get:
tt <- tktoplevel()
for (i in c("hello", "HALLO"))
tkpack (tkbutton (tt, text=i,
command=function()cat(i,"world\n")), fill="x")
tkpack (tkbutton (tt, text="dismiss",
command=function()tkdestroy(tt)), fil...
2007 May 30
5
determining a parent function name
Hi, All,
I'm writing a wrapper for stop that produces a popup window using tcltk.
Something like:
error <- function(...) {
msg <- paste(..., sep = "")
if(!length(msg)) msg <- ""
if(require(tcltk, quiet = TRUE)) {
tt <- tktoplevel()
tkwm.title(tt, "Error")
tkmsg <- tktext(tt, bg = "white")
tkinsert(tkmsg, "end", sprintf("Error in %s: %s", "???", msg))
tkconfigure(tkmsg, state = "disabled", font = "Tahoma 12",
width =...
2000 Sep 28
0
No subject
...to implement that functionality in R.....what am I doing wrong?
> I enclose below the sample function...Any help will be greatly
> appreciated....
>
> "tcltktst" <-
+ function(x="") {
+ xd <- read.table(x, header=T)
+ library("tcltk")
+
+ tt <- tktoplevel()
+ tktitle(tt) <- "Diagnostics"
+ label.widget <- tklabel(tt, text="Choose!")
+
+ pptlabs <- function() {
+ plot(xd$iv802, xd$PPT)
+ abline(0,1)
+ tt2 <- tktoplevel()
+ tktitle(tt2) <- "Identify Outliers"
+ lab.wid2 <- tklabel(tt2,...
2011 Feb 27
1
R Tcl/Tk [MacOSX] TkButton Problem
Hi,
I have a tktoplevel window and in it a tkbutton:
AUS <- function()
{
foo(parameters);
}
AUSButton.but <- tkbutton(tt,text="OK",command=AUS)
The function foo(...) does a time-consuming calculation, and during this calculation there is printed some progress information to the console.
My problem: Whe...
2012 Nov 19
6
tcltk freezing using MS Windows for R-2.14+
...nsistently 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",...
2000 Sep 29
1
Two tcltk questions and Re: tcltk package functionality
...cltk action is done
you have to use the tk-function tkwait.variable().
The following function -- a simple modification of Prasad's
tcltktst function -- shows an example:
tcltk.test <- function(x1=1:10, x2=10:1) {
library("tcltk")
# define first toplevel-widget
tt <- tktoplevel()
tktitle(tt) <- "Diagnostics"
label.widget <- tklabel(tt, text="Choose data for plot!")
rbut.wid1 <- tkradiobutton(tt, text="x1", value="0", variable="choice")
rbut.wid2 <- tkradiobutton(tt, text="x2", value="1...
2003 Jan 20
1
curious code mistakes
...gt;> if (name == "") return;
Error: syntax error
>> zz <- read.spss(name, use.value.label=T, to.data.frame=T)
Error: syntax error
>> assign("myData", zz, envir = .GlobalEnv)
Error: syntax error
>>}
Error: syntax error
>>tt <- tktoplevel()
>>button.widget <- tkbutton(tt,text="Select SPSSFile", command=getfile)
Error in .Tcl.args(...) : Object "getfile" not found
>>tkpack(button.widget)
Error in .Tcl.args(...) : Object "button.widget" not found
>>
>>
>>getfile <- func...
2023 Mar 13
1
tcl tk: set the position button
...8:41 p.m., Rodrigo Badilla wrote:
> Hi all,
> I am using tcltk2 library to show buttons and messages. Everything
> work fine but I would like set the tk2button to the right of my screen, by default it display at the left of my screen.
> my script example:
> library(tcltk2) win1 <- tktoplevel() butOK <- tk2button(win1, text = "TEST", width = 77) tkgrid(butOK)
> Thanks in advance
> Saludos
> Rodrigo
>
>
> --
> Este correo electr?nico ha sido analizado en busca de virus por el software antivirus de Avast.
> www.avast.com
> [[alternative HTML vers...
2012 May 24
3
set tkscale by tkentry
Hi, I am working under Windows and I am using R2.11
I want to use tkscale in my GUI. As the interval is quite big, I can't set
the scale to a certain specific value. Therefore I want to add tkentry to
allow the user to set tkscale to a certain value.
Here is the code
library(tcltk)
tt<-tktoplevel()
tkpack(m1<-tkscale(tt,from=306870.00, to=3026741, label="alpha",
variable="varalpha",showvalue=TRUE, resolution=1,
orient="horiz"),side="bottom")
tkpack(tkentry(tt,width="10",textvariable="varalpha",validate="key",validateco...
2006 May 22
1
rerender tcltk toplevel
...d to have a
backup there. So my second strategy was to use a simple toplevel with a
label and update the tclvariable assigned to it. This works nicely on
windows systems but on my linux box (Suse10) the label is not updated on
every round of iteration but rather once the iterator finishes.
tt <-tktoplevel()
tkwm.geometry(tt, "250x140")
prog <- tclVar("0")
label <- tklabel(tt, textvariable=prog)
tkgrid(label)
for(i in 1:50) {
tmp <- rnorm(1e+05)
tclvalue(prog) <- i*2
}
When I combine both approaches and add the label to a toplevel that
already contains the p...
2020 Jun 07
7
use of the tcltk package crashes R 4.0.1 for Windows
Hi,
The following code, from the examples in ?TkWidgets , immediately crashes R 4.0.1 for Windows:
--------------------- snip --------------------
library("tcltk")
tt <- tktoplevel()
label.widget <- tklabel(tt, text = "Hello, World!")
button.widget <- tkbutton(tt, text = "Push",
command = function()cat("OW!\n"))
tkpack(label.widget, button.widget) # geometry manager
--------------------- snip --------------------
Session info (prior to...
2006 Mar 07
2
Building tkentry dynamicly
Dear R-users,
I would like to build N "tkentry" compounds in the same window, with
default text for each. As N is variable I need to construct them in an
iterative way :
library(tcltk)
main<-tktoplevel()
tktitle(main)<-"My Tool"
filenames<-c("toto","tata","titi")
N<-length(filenames)
for (i in 1: N) {
text<-tclVar(filenames[i]) # get a filename (string value)
textField<-tkentry(main,textvariable=text) # build a text field...
2005 Jun 04
2
locator() via tcltk
....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 <- function(...) {
locator(5)
}
x <- 1:1000
y <- rnorm(1000)
plot(x, y)
base <- tktoplevel()
loc.pts <- tkbutton(base, text = "Get coordinates", command = getcoords)
quit.but <- tkbutton(base, text = "Quit",
command = function() tkdestroy(base))
tkpack(loc.pts, quit.but)
}
I'd like testplot to return the value from getcoords. Th...