ghosh123 has asked for the wisdom of the Perl Monks concerning the following question:
================================================== Now the items appear as "first", "second" ,"third" and "fourth" in row1 row2,row3 and row4 respectively. My requirement is to alter the order of appearence by clicking or pressing up/down key. For example after the order would appear as "second" "first" "fouth" and "third". Kindly help . Thanks in advance. -AGmy $mw = MainWindow -> new(); my $lb = $mw -> Scrolled("Listbox", -scrollbars=>'e' , ) -> pack( -side => 'left' , -fill => 'y' ); foreach my $key ("first" , "second" , "third", "fourth") { $lb -> insert( 'end', $key ); } $lb->activate ( 0 ) ; $lb->selectionSet ( 0 ) ; $lb->focus; $lb -> bind ('<Key-Down>', sub {print "Down\n"} ); $mw -> bind ('<Key-Up>', sub {print "\nUP"} ); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to move up/down the row element in a ListBox/Mlistbox
by GrandFather (Saint) on Feb 01, 2012 at 07:24 UTC | |
|
Re: How to move up/down the row element in a ListBox/Mlistbox
by chessgui (Scribe) on Feb 01, 2012 at 07:13 UTC | |
|
Re: How to move up/down the row element in a ListBox/Mlistbox
by thundergnat (Deacon) on Feb 01, 2012 at 16:59 UTC | |
by gllore (Acolyte) on Oct 13, 2017 at 18:46 UTC | |
by gllore (Acolyte) on Oct 27, 2017 at 13:20 UTC |