Grubber has asked for the wisdom of the Perl Monks concerning the following question:

I am using selectionIncludes to test for a selected index within a Listbox:
if($lb->selectionIncludes($i) == 1)
This works fine from my main window. However,
if($lb2->selectionIncludes($i) == 1)
does not work being the $lb2 is from a tab window using Tk:NoteBook example:
$book = $main->NoteBook()->pack( -side=>'bottom',-fill=>'x', -ipadx=>0 +, -ipady=>185, -expand=>0 ); $tab3 = $book->add( "Sheet 3", -label=>"Reports", -createcmd=>\&Report +s, -raisecmd=>\&Reports, -state=>'normal' );
Has anyone used multiple Listboxes via NoteBook?

Edit by castaway - added code tags

Replies are listed 'Best First'.
Re: Listbox selectionIncludes
by zentara (Cardinal) on Mar 12, 2005 at 22:26 UTC
    You should be able to do it, if you are keeping track of your objects properly. Your example code dosn't really show anything about the listbox in the notebook. Could you make a simple example which runs, and demonstrates your problem?

    Finally, when using multiple listboxes, a common problem is the listbox arg -exportselection, try setting it to 0.

    -exportselection=> 0

    I'm not really a human, but I play one on earth. flash japh