Hi Monks,
I need one push in regard to move a row element up and down
by clicking a button or pressing Up/Down key.
Let us consider this small code below
================================================
my $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;
==================================================
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.
-AG
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.