How to show the selectio in two listbox! 
Author Message
 How to show the selectio in two listbox!

Dear all:

    I have a big probelm, but I have no idea to solve. Currently, I have two
listbox LB1 and LB2 in one window (ok, that say panel). Then I have to
select some items in these two list box. After I done the selection of LB1,
when I change to select LB2, the oginial selection item in LB1 are gone. How
do I solve this problem? Any idea or suggestion will be very appreciate.

Best Regards, Mark



Tue, 28 May 2002 03:00:00 GMT  
 How to show the selectio in two listbox!

Quote:

> Dear all:

>     I have a big probelm, but I have no idea to solve. Currently, I have two
> listbox LB1 and LB2 in one window (ok, that say panel). Then I have to
> select some items in these two list box. After I done the selection of LB1,
> when I change to select LB2, the oginial selection item in LB1 are gone. How
> do I solve this problem? Any idea or suggestion will be very appreciate.

> Best Regards, Mark

Have a look at the "-exportselection" parameter on the "options" man
page.
As X can have only one selection at the time it removes all other
selections when one thingagummy gets the selection. Items that do not
export their selection can stay selected even if an other item gets
selected.

Hope that helps.

Live!
        Stefan.



Tue, 28 May 2002 03:00:00 GMT  
 How to show the selectio in two listbox!

Quote:

> Dear all:
>     I have a big probelm, but I have no idea to solve. Currently, I have two
> listbox LB1 and LB2 in one window (ok, that say panel). Then I have to
> select some items in these two list box. After I done the selection of LB1,
> when I change to select LB2, the oginial selection item in LB1 are gone. How
> do I solve this problem? Any idea or suggestion will be very appreciate.

Read the man page (html page, help file section) on listbox and look at the
-exportselection option.

L

--
Penguin Power!           Nothing I say reflects the views of my employer


CGI - FWFM Project                                 Phone: (514) 350-3368



Tue, 28 May 2002 03:00:00 GMT  
 How to show the selectio in two listbox!

Quote:
>Dear all:

>    I have a big probelm, but I have no idea to solve. Currently, I have two
>listbox LB1 and LB2 in one window (ok, that say panel). Then I have to
>select some items in these two list box. After I done the selection of LB1,
>when I change to select LB2, the oginial selection item in LB1 are gone. How
>do I solve this problem? Any idea or suggestion will be very appreciate.

>Best Regards, Mark

I've come accross this same thing.  It would be very nice if listbox
had a 'command' option like button so that when you select something
it can immediately update another window.  

I personally don't see how exporting something to X-windows clipboard
is going to help in this matter.  What I am looking to do is once
there is a click on a listbox to update a text widget which has the
details of that item i have selected.  Of course I can push a button,
to get the update, but it seems a bit obfuscated.



Tue, 28 May 2002 03:00:00 GMT  
 How to show the selectio in two listbox!

Quote:


>>Dear all:

>>    I have a big probelm, but I have no idea to solve. Currently, I have two
>>listbox LB1 and LB2 in one window (ok, that say panel). Then I have to
>>select some items in these two list box. After I done the selection of LB1,
>>when I change to select LB2, the oginial selection item in LB1 are gone. How
>>do I solve this problem? Any idea or suggestion will be very appreciate.

>>Best Regards, Mark

>I've come accross this same thing.  It would be very nice if listbox
>had a 'command' option like button so that when you select something
>it can immediately update another window.  

>I personally don't see how exporting something to X-windows clipboard
>is going to help in this matter.  What I am looking to do is once
>there is a click on a listbox to update a text widget which has the
>details of that item i have selected.  Of course I can push a button,
>to get the update, but it seems a bit obfuscated.

actually I solved this by using 'bind' to my listbox when buttons are
released.  I check the listbox for curselection, if it exists, I
update the window.  I have the options on my listbox so only one
selection can be made at a time.


Tue, 28 May 2002 03:00:00 GMT  
 How to show the selectio in two listbox!

Quote:


>>Dear all:

>>    I have a big probelm, but I have no idea to solve. Currently, I have two
>>listbox LB1 and LB2 in one window (ok, that say panel). Then I have to
>>select some items in these two list box. After I done the selection of LB1,
>>when I change to select LB2, the oginial selection item in LB1 are gone. How
>>do I solve this problem? Any idea or suggestion will be very appreciate.

>>Best Regards, Mark
> I've come accross this same thing.  It would be very nice if listbox
> had a 'command' option like button so that when you select something
> it can immediately update another window.  
> I personally don't see how exporting something to X-windows clipboard
> is going to help in this matter.  What I am looking to do is once
> there is a click on a listbox to update a text widget which has the
> details of that item i have selected.  Of course I can push a button,
> to get the update, but it seems a bit obfuscated.

There's a package called wcb, I think, which implements such widget callbacks.
Look for it somewhere in the Big FAQ: http://www.purl.org/net/tcl-faq/

L

--
Penguin Power!           Nothing I say reflects the views of my employer


CGI - FWFM Project                                 Phone: (514) 350-3368



Tue, 28 May 2002 03:00:00 GMT  
 How to show the selectio in two listbox!
[Hmm.  My webserver seems to be missing the relevant posts, so I'll
piggyback instead...]

Quote:


>>>    I have a big probelm, but I have no idea to solve. Currently, I
>>> have two listbox LB1 and LB2 in one window (ok, that say
>>> panel). Then I have to select some items in these two list
>>> box. After I done the selection of LB1, when I change to select
>>> LB2, the oginial selection item in LB1 are gone. How do I solve
>>> this problem? Any idea or suggestion will be very appreciate.

You need to turn off exporting of the selection, so passing
   -exportselection 0
as an option in your listbox creation command should do the trick.
Though you will now need to explicitly query the listbox to find out
what is selected.

Quote:
>> I've come accross this same thing.  It would be very nice if listbox
>> had a 'command' option like button so that when you select something
>> it can immediately update another window.  

Try binding to <<ListboxSelect>> on the listbox in question.  That
virtual event is generated whenever the selection in the listbox is
changed.

Donal.
--

-- The small advantage of not having California being part of my country would
   be overweighed by having California as a heavily-armed rabid weasel on our



Mon, 03 Jun 2002 03:00:00 GMT  
 How to show the selectio in two listbox!
Quote:

> Try binding to <<ListboxSelect>> on the listbox in question.  That
> virtual event is generated whenever the selection in the listbox is
> changed.

Can anyone point out where/how this binding is defined. I haven't been
able to find it in docs, C source, or listbox.tcl.
Quote:

> Donal.
> --

> -- The small advantage of not having California being part of my country would
>    be overweighed by having California as a heavily-armed rabid weasel on our




Mon, 03 Jun 2002 03:00:00 GMT  
 How to show the selectio in two listbox!

Quote:


> > Try binding to <<ListboxSelect>> on the listbox in question.  That
> > virtual event is generated whenever the selection in the listbox is
> > changed.
> Can anyone point out where/how this binding is defined. I haven't been
> able to find it in docs, C source, or listbox.tcl.

It was something I introduced first as a patch on the newsgroup,
and was adopted into 8.1.1 I believe.  It is for sure in 8.2,
but still undocumented (I hadn't realized that the core group
had actually adopted it...).  I'll make sure to doc it for 8.3.

--
   Jeffrey Hobbs                          The Tcl Guy
   jeffrey.hobbs at scriptics.com         Scriptics Corp.



Mon, 03 Jun 2002 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Help - Listbox not showing headers in Windows

2. ListBox headings not showing

3. Row in browse box shows two times

4. Listbox showing parent-child relation

5. Show 2nd field format in listbox with drop

6. Listbox showing garbage

7. Listbox that shows selection

8. Selecting more items from listbox than shown

9. SelectIO instantiation

10. Scrolling two listboxes?

11. C4 - Two listboxes of same file

12. Linking Two Browse Listboxes

 

 
Powered by phpBB® Forum Software