Listbox and dropdownlistbox

Torbjörn Lager lager at ling.gu.se
Mon Apr 14 16:32:44 CEST 2003


Donatien Grolaux wrote:

> this looks like a strange behavior from tcl/tk : there can be only one 
> list with items selected at a time. Unfortunately QTk inherits this 
> property, and we can't do much about it. I guess the only solution is to 
> use a canvas to implement a listbox widget with multiple selection and 
> use that instead of the real listbox widget.

I once had this problem myself, and the answer is here:

   http://tcl.sourceforge.net/faqs/tk/#listbox/export

Cheers,
Torbjörn

> Donatien
> 
> HALA MOSTAFA wrote:
> 
>> Hi,
>> I was working on an interface involving (among other widgets) a 
>> listbox and a dropdownlistbox widget. They're not getting along very 
>> well. It seems that changing the current selection of the 
>> dropdownlistbox somehow cancels the selection of the listbox!!
>> I am using Windows 2000 and Mozart 1.2.4
>> I include here a simple version of the problem:
>>
>> declare
>> [QTk] = {Module.link ['x-oz://system/wp/QTk.ozf']}
>> Lbl DD DDList=[one two three four]
>> DropDown = lr(label(init:one handle:Lbl padx:4 bg:white relief:sunken 
>> width:10)
>>           dropdownlistbox(init:DDList handle:DD))
>>
>> LB LBoxList=[hi there every one]
>> proc{P}
>>   SelStates = {LB get(selection:$)}
>>   ChoiceStates = {List.mapInd SelStates fun{$ Idx Sel}
>>                         {Nth LBoxList Idx}#Sel
>>                      end}
>>   SelChoices = {Filter ChoiceStates fun{$ E}
>>                     E.2
>>                      end}
>>   NewChoices = {Map SelChoices fun{$ C} C.1 end}
>> in
>>   {Browse [currently selected NewChoices]}
>> end
>>
>> LBox = lr(listbox(init:LBoxList handle:LB selectmode:multiple bg:white 
>> height:3
>>           tdscrollbar:true selectbackground:cyan action:P))
>> in
>> {{QTk.build td(DropDown LBox button(text:see action:P))} show}
>>
>> If the dropdownlistbox's arrow is pressed but no selection from it is 
>> made, whatever was selected in the listbox remains selected, but if 
>> something is selected from the dropdownlistbox, the lisbox's selection 
>> is lost.
>>
>> So, what can the problem be??
>>
>> Thank you
>>
>>
>> _________________________________________________________________
>> MSN 8 with e-mail virus protection service: 2 months FREE*  
>> http://join.msn.com/?page=features/virus
>>
>> -
>> Please send submissions to users at mozart-oz.org
>> and administriva mail to users-request at mozart-oz.org.
>> The Mozart Oz web site is at http://www.mozart-oz.org/.
>> Please send bug reports to bugs at mozart-oz.org.
> 
> 
> 
> 
> -
> Please send submissions to users at mozart-oz.org
> and administriva mail to users-request at mozart-oz.org.
> The Mozart Oz web site is at http://www.mozart-oz.org/.
> Please send bug reports to bugs at mozart-oz.org.
> 


-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
Please send bug reports to bugs at mozart-oz.org.





More information about the mozart-users mailing list