Hi everyone,
I have different listboxes in the same toplevel window.
The problem is, if I select (by left clicking) one of those listbox
elements, the current selection in the other listboxes is cleared!
Anybody knows how I can prevent this?
Thanks,
---------------------------------------------------
Rita Sousa
DME - ME: Departamento de Metodologia Estatística - Métodos Estatísticos
INE - DRP: Instituto Nacional de Estatística - Delegação Regional do Porto
Tel.: 22 6072016 (Extensão: 4116)
---------------------------------------------------
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<-tklistbox(janela,height=4,selectmode="multiple",background="white")
tkgrid(tklabel(janela,text="Seleccione o(s) trimestre(s):"))
tkgrid(tl)
trim <- c("T1","T2","T3","T4")
for (i in (1:4))
{
tkinsert(tl,"end",trim[i])
}
#tkselection.set(tl,2)
#Listbox com as regiões
t2<-tklistbox(janela,height=4,selectmode="multiple",background="white")
tkgrid(tklabel(janela,text="Seleccione pelo menos uma das regiões:"))
tkgrid(t2)
reg <- c("Norte","Centro, Lisboa e
Alentejo","Açores","Madeira")
for (i in (1:4))
{
tkinsert(t2,"end",reg[i])
}
...
[[alternative HTML version deleted]]
Rita, give the exportselection=FALSE argument to tklistbox. (If i'm not mistaken.) G. On Tue, Dec 12, 2006 at 11:55:58AM -0000, Rita Sousa wrote:> Hi everyone, > > I have different listboxes in the same toplevel window. > The problem is, if I select (by left clicking) one of those listbox > elements, the current selection in the other listboxes is cleared! > Anybody knows how I can prevent this? > > Thanks, > > --------------------------------------------------- > Rita Sousa > DME - ME: Departamento de Metodologia Estat?stica - M?todos Estat?sticos > INE - DRP: Instituto Nacional de Estat?stica - Delega??o Regional do Porto > Tel.: 22 6072016 (Extens?o: 4116) > ---------------------------------------------------[...] -- Csardi Gabor <csardi at rmki.kfki.hu> MTA RMKI, ELTE TTK
Hi Rita,
This is the option you are looking for:
Command-Line Name: -exportselection
Database Name: exportSelection
Database Class: ExportSelection
Specifies whether or not a selection in the widget should also be
the
X selection. The value may have any of the forms accepted by
Tcl_GetBoolean, such as true, false, 0, 1, yes, or no. If the
selection is exported, then selecting in the widget deselects the
current X selection, selecting outside the widget deselects any
widget
selection, and the widget will respond to selection retrieval
requests
when it has a selection. The default is usually for widgets to
export
selections.
Use it by giving tklistbox the argument exportselection=0.
JeeBee.