search for: tkgrid

Displaying 20 results from an estimated 73 matches for "tkgrid".

2010 Jul 21
1
tcltk resizing when using tkgrid for layout
...imensions, but this doesn't help at all when the window is resized. From reading the TclTK documentation, it seems like the 'rowconfigure' and 'columnconfigure' methods of the grid are supposed to solve this problem by setting the 'weight' grid option. There exists a tkgrid.rowconfigure() command and the following invocation did not produce any errors... tkgrid.rowconfigure(mywidget,0,weight=1) ...but it didn't make the widget dynamically resize with the parent window either. Either I'm invoking it incorrectly, or it doesn't actually do what I think i...
2012 Jul 16
2
Tk grid problem
...- tktoplevel(borderwidth=10) A.but <- tkbutton(tt,text="A",command=function()ls()) B.but <- tkbutton(tt,text="B",command=function()ls()) C.but <- tkbutton(tt,text="C",command=function()ls()) D.but <- tkbutton(tt,text="D",command=function()ls()) tkgrid(A.but,row=1,column=1,columnspan=2,rowspan=2,sticky="nswe") tkgrid(B.but,row=3,column=1,columnspan=2,rowspan=1,sticky="nswe") tkgrid(C.but,row=1,column=3,columnspan=2,rowspan=1,sticky="wens") tkgrid(D.but,row=3,column=3,columnspan=2,rowspan=2,sticky="wens")...
2009 Oct 19
1
Problem with geometry manager in TclTK
...rm <- 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 Format", font="Times 15", foreground="dark red")) tkgrid(Title.frame) Choose.frame <- tkframe(ask.form, relief="groove", borderwidth=2) file.format1 <- tkradiobutton(Choose.frame) file.format2 <- tkradiob...
2008 Dec 22
1
newbie question on tcltk
...dy=70) frameOverall <- tkframe(top) frameUpper <- tkframe(frameOverall,relief="groove",borderwidth=2) back_but <- tkbutton (frameUpper, text = "BACK", width=20, height=1, default="active", overrelief="flat",anchor="w", borderwidth=4 ) tkgrid(frameUpper) tkgrid(frameOverall) tkpack (frameUpper, back_but, side='left', anchor='n') tkgrid(tklabel(top,text=" ")) fontHeading <- tkfont.create(family="arial",size=14,weight="bold") other_window <- function () { tkdestroy(top) t...
2008 Nov 03
1
possible tcltk event loop problem
...l, ...)) tkconfigure(.output, yscrollcommand=function(...) tkset(outputYscroll, ...)) Note that the functions MessagesWindow(), LogWindow(), and OutputWindow() simply return their respective tk windows. These windows are also similarly placed in the master Rcmdr window (slightly edited): tkgrid(.log, logYscroll, sticky="news", columnspan=2) tkgrid(logXscroll) tkgrid(logFrame, sticky="news", padx=10, pady=0, columnspan=2) tkgrid(.output, outputYscroll, sticky="news", columnspan=2) tkgrid(outputXscroll, columnspan=1 + (.log.commands &&...
2008 Mar 19
1
Radio Buttons or similars
...function function1<-function(){ require(tcltk) tt <- tktoplevel() rb1 <- tkradiobutton(tt) rb2 <- tkradiobutton(tt) rbValue <- tclVar("oranges") tkconfigure(rb1,variable=rbValue,value="apples") tkconfigure(rb2,variable=rbValue,value="oranges") tkgrid(tklabel(tt,text="Which do you prefer?")) tkgrid(tklabel(tt,text="Apples "),rb1) tkgrid(tklabel(tt,text="Oranges "),rb2) value<-0; aux_function<- function() { rbVal <- as.character(tclvalue(rbValue)) tkdestroy(tt) if (rbVal=="apples&quo...
2007 Oct 08
3
tcltk scrollbar
...ll subsequent listboxes and scrollbars work perfectly, the first one (column 1 of main window) is the only one constantly off. library(tcltk) tt<-tktoplevel() mainFont<-tkfont.create(family="times",size=16) lbl.MainT<-tklabel(tt,text="Basic Manipulation",font=mainFont) tkgrid(lbl.MainT,sticky="nw") but.Browse<-tkbutton(tt,text=" Browse ",command=browse) but.Apply<-tkbutton(tt,text=" Apply ") scr1 <- tkscrollbar(tt, repeatinterval=5,command=function(...)tkyview(lsbDim1,...)) scr2 <- tkscrollbar(tt, repeatinterval=5,command=functi...
2008 Jul 22
1
tklistbox and extracting selection to R
Dear experts, I am trying to understand why is it that when I paste (into the R console) the following code to select an option from a list: require(tcltk) tt<-tktoplevel() tl<-tklistbox(tt,height=ntx,selectmode="single",background="white") tkgrid(tklabel(tt,text="Select the legend of" )) tkgrid(tl) treatments<<-levels.tx for(i in (1:ntx)) { tkinsert(tl,"end",treatments[i]) } OnOK<-function() { tx.choice1<<-treatments[as.integer(tkcurselection(tl))+1] tkdestroy(tt)...
2008 Nov 23
1
tklistbox - R-Objekt
...tklistbox. The user should be able to choose one out of two calculation methods needed for further calculations. My r-script for that purpose looks like that: require(tcltk) tt<-tktoplevel() tl<-tklistbox(tt,height=4,selectmode="single",background="white") tkgrid(tklabel(tt,text="select method for LAI calculation")) tkgrid(tl) method<- c("method1","method2") for (i in (1:2)){ tkinsert(tl,"end",method[i]) } tkselection.set(tl,0) OnOK <- function(){ choice<-method[as.num...
2008 May 07
1
Aling elmentos into Windows with TK
Hello!! I would like create a window that has diferent element as: http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/checkboxes.html http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/radiobuttons.html I know as make it, but I don?t know as I could (align the diferent elemnts to left, right, top, bottom) or (put in a coordinates into windows). If anybody know as I could make it, I would
2008 Mar 31
2
tkconfigure throws an error
...to a button please help: ############ library(tcltk) tt<- tktoplevel() tktitle(tt)<-"the title" heading<-tklabel(tt,text="Enter date as YYYY-MM-DD") l1<-tklabel(tt,text="Reporting date") b1=tkbutton(tt,text="Run") d.val<-tkentry(tt,width=12) tkgrid(heading,columnspan=2) tkgrid(l1,d.val) tkgrid(b1,columnspan=2) tkconfigure(b1,command=source("./src/f.imm2.R")) ######### and get inconsistent errors: 1. Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class = "tclObj") : [tcl] invalid...
2005 Sep 05
1
tcltk, X11 protocol error: Bug?
...quot;,bg=b.color) canvas.e <- tkcanvas(bframe,width="50",height="25",bg=e.color) canvas.r <- tkcanvas(tt,width="300",height="50",bg="white") BColor.button <- tkbutton(bframe,text="Begin Color",command=B.ChangeColor) ##tkgrid(canvas.b,BColor.button) EColor.button <- tkbutton(bframe,text="End Color",command=E.ChangeColor) killbutton <- tkbutton(bframe,text="Save",command=save.ramp) tkgrid(canvas.b,BColor.button,canvas.e,EColor.button) tkgrid(bframe) tkgrid(frame) tkgrid(canvas.r)...
2009 Sep 28
2
re trieve user input from an tcl/tk interface
...the important stuff should happen... tkdestroy(tt) } require(tcltk) tclRequire("BWidget") tt = tktoplevel() trials = tclVar("100") # I want to suggest default values but they should be editable. entry.trials = tkentry(tt, width = "3", textvariable = trials) tkgrid(tklabel(tt,text="Number of trials:")) tkgrid(entry.trials) Stimuli = tclVar("10") # 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:...
2008 Jun 16
0
Display a jpeg inside a widget which already has text
...;- tkfont.create(family="arial",size=16, slant="italic") fontHeading3 <- tkfont.create(family="arial",size=12) fontTextLabel <- tkfont.create(family="arial",size=12) fontlabel <- tkfont.create(family="arial",size=10,weight="bold") tkgrid(tklabel(tt,height=2,width=50, text="")) tkgrid(tklabel(tt,text="")) tkgrid(tklabel(tt,text="'Enhance Your Decision Making'",font=fontHeading2,foreground="black")) tkgrid(tklabel(tt,text=" v 4.0", font=fontTextLabel)) tkgrid(tklabel(tt,heigh...
2007 May 13
1
Dropdown boxes in tcltk and R
...t code, however, and the ask for fruitChoice it says 'error not found'. I suspect it's because its embedded in a function, but I can't work out how to unravel it. I've tried something like this to no avail. require(tcltk) tclRequire("BWidget") tt <- tktoplevel() tkgrid(tklabel(tt,text="What's your favorite fruit?")) fruits <- c("Apple","Orange","Banana","Pear") comboBox <- tkwidget(tt,"ComboBox",editable=FALSE,values=fruits) tkgrid(comboBox) OnOK <- function() { tkdestroy(tt) msg &l...
2006 Dec 12
2
tklistbox...
...) --------------------------------------------------- require(tcltk) #Criação da janela janela <- tktoplevel() tkwm.title(janela,"Apuramentos - Inquérito ao Emprego") #Estilo do texto estilo_texto <- tkfont.create(family="verdana",size=8,weight="bold") tkgrid(tklabel(janela,text="Trimestre:",font=estilo_texto)) cb1 <- tkcheckbutton(janela) cb1Valor <- tclVar("0") tkconfigure(cb1,variable=cb1Valor) tkgrid(tklabel(janela,text="1T"),cb1) #Listbox com os trimestres #janela <-tkframe(janela) tl<-tkli...
2005 Feb 28
1
Getting width of Tk text widget via tcltk
...code, the reported width of the text widget doesn't change, even though it has been resized. I can, however, get the current width in pixels: > library(tcltk) > top <- tktoplevel() > textWindow <- tktext(top, bg="white", height=20, width=80, wrap="none") > tkgrid(textWindow, sticky="news") <Tcl> > tkgrid.rowconfigure(top, 0, weight=1) <Tcl> > tkgrid.columnconfigure(top, 0, weight=1) <Tcl> > tkcget(textWindow, width=NULL) <Tcl> 80 > tkwinfo("width", textWindow$ID) <Tcl> 486 > # resize...
2009 Jul 09
1
Changing text in a tkentry widget
...when a button is pressed. Once I get that working, the widget will be read only to the user. Here is some toy code: ############### require(tcltk) thisEnv=environment() tt<-tktoplevel() Name <- tclVar("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/~wette...
2009 Apr 28
1
[macosx] improving quartz & Aqua Tk behaviour outside of RGui
Hello, On Mac OS X, certain Aqua/Quartz UI functionality requires an application to be launched from within an app bundle, or (alternatively) requires a Carbon application with a resource fork. Playing with the wxWidgets distribution, I discovered that it is quite easy and transparent to make such a Carbon app from (I guess) any command line application. When applied to the R executable called
2009 Apr 28
1
[macosx] improving quartz & Aqua Tk behaviour outside of RGui
Hello, On Mac OS X, certain Aqua/Quartz UI functionality requires an application to be launched from within an app bundle, or (alternatively) requires a Carbon application with a resource fork. Playing with the wxWidgets distribution, I discovered that it is quite easy and transparent to make such a Carbon app from (I guess) any command line application. When applied to the R executable called