in reply to Re^2: How to enter a MAC address
in thread How to enter a MAC address
Well, I'm impressed. Learning Perl takes enough effort (though mostly fun :-D), and Tk is no simple discipline to master. Good for you!
If you want to display hexadecimal, you could just use sprintf to reformat each hex pair before the assignment:
$mw->Entry(-textvariable => [ sprintf "%02x", $addy[$i] ], -width => 3 +) ->pack(-side => 'left');
Another minor suggestion: check your loop variable so you don't print an extra ':' after the final byte:
if ($i < 5) { $mw->Label(-text => ':', -width => 1)->pack(-side => 'left'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to enter a MAC address
by snotnose (Novice) on Feb 15, 2007 at 00:00 UTC | |
by liverpole (Monsignor) on Feb 15, 2007 at 00:14 UTC |