#!/usr/binperl -w use strict; use warnings; use Tk; use Tk::LabFrame; use Tk::ROText; my $mw = MainWindow->new(); $mw->geometry("500x400"); my $f1 = $mw->LabFrame( -label => "List-box-selection", -font => 'ukai', -labelside => "acrosstop", )->pack(); my @list = (qw/test1 test2 test3 test4 test5/); my $lb = $f1->Scrolled( "Listbox", -scrollbars => "e", -selectmode => "extended", -font => 'ukai', -activestyle => "dotbox", )->pack(); $lb->insert( 'end', @list ); my $txt_scroll; $lb->bind( '' => sub { my $current_ip = $_[0]->get( $_[0]->curselection ); $txt_scroll->insert( 'end', "SELECTED IP : $current_ip\n" ); }, ); my $f2 = $mw->LabFrame( -label => "Commands Info", -font => 'ukai', -labelside => "acrosstop", )->pack(); $txt_scroll = $f2->Scrolled( 'ROText', -scrollbars => 'osoe', -height => 6, -width => 25, -font => 'ukai', )->pack(); $mw->update(); MainLoop;