Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: perl/tk HLIST selections options

by SciDude (Friar)
on Jul 09, 2004 at 04:21 UTC ( #373040=note: print w/replies, xml ) Need Help??

in reply to perl/tk HLIST selections options

Selecting everything is simple enough:

# select everything $lb->selectionSet(0, 'end' );

But, you only want to do this if no entry is selected.

@selected = $lb->curselection; unless (@selected) { $lb->selectionSet(0, 'end' ); } foreach (@selected) { # do something with the index in $_ }


The first dog barks... all other dogs bark at the first dog.

Replies are listed 'Best First'.
Re^2: perl/tk HLIST selections options
by (Acolyte) on Jul 09, 2004 at 05:06 UTC
    selectionSet(0, 'end' ); dint seem to work it gives me an error entry end not found

      Looking around some more, you may be able to get at the "end" value:

      $listbox->index(index) Returns the integer index value that corresponds to index. If inde +x is end the return value is a count of the number of elements in the + listbox (not the index of the last element).

      Really, really untested code. Good luck!

      The first dog barks... all other dogs bark at the first dog.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://373040]
[Corion]: marto: Ouch :/ And having that as a (written) policy strikes me as inane...
[Corion]: So maybe you can use that momentum in the household instead, or use it for taxes or other chores ;)
[choroba]: At $job - 1, sending anything to one's personal account was prohibited and watched over
[marto]: a couple of guys who live locally are in the office, so I'm sure I'll spend most of the day fielding their questions :P
[marto]: choroba exactly, the employer is incredibly stupid

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-01-16 08:59 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (175 votes). Check out past polls.