select everything in a listbox? 
Author Message
 select everything in a listbox?

Quote:

> I'm working with a listbox and want to be able to click a button to
> select/unselect everything in the listbox.  Anyone have any suggestions
> on how to do this?

  Give this a shot.  You would probably want to set the selection method to
'extended' or 'multiple'.

-Bill P.

#!/usr/local/bin/perl

use Tk;

my $window = MainWindow->new;
my $listbox = $window->Listbox()->pack(-side => 'top');

foreach ("Item a","Item b","Item c","Item d","Item e","Item f" ) {
    $listbox->insert('end',$_);

Quote:
}

my $button = $window->Button(-text => 'Select All',
                             -command => [ $listbox, 'selectionSet',0,'end'])
    ->pack(-side => 'top');

MainLoop;



Tue, 11 May 1999 03:00:00 GMT  
 select everything in a listbox?

I'm working with a listbox and want
to be able to click a button to select/unselect
everything in the listbox.
Anyone have any suggestions on how to do this?

thanks,
Judy
--

          --/  ##########################################            --/
//\ ____/ /\(    "The more I get to know cowboys, the      //\ ____/ /\(
))( )___ )__      more I like my horse....."               ))( )___ )__  
jj//    |  /   ##########################################  jj//    |  /  
  |\    |               Judy Ballard                         |\    |    
                      SAS Institute Inc.



Tue, 11 May 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. default select behaviour of Listbox and HList

2. React on Selected Item in Listbox

3. Listbox - won't stay selected

4. Listbox focus and selecting

5. Error selecting first item in listbox

6. Problem selecting items from multiple listboxes

7. Finding items selected in a Listbox

8. Problem with selecting listbox item

9. listbox keep showing the selected item?

10. making Listbox a listbox disabled

11. HTML::Template Select Retrievel of selected value

12. challence to regex gurus: selecting within selected paragraphs

 

 
Powered by phpBB® Forum Software