# Code to create scrolled widget my @CreateOptions = ['ROText', -label=>"Phone $Id", -labelPack => [-side => 'top', -expand => 0, -anchor => 'w', -fill => 'y'], -wrap => 'none', -relief => 'groove', -width=>$Width, -fg=>'white',-background=>"black", -scrollbars => 'se']; @PackOptions = [-row=>0, -column=>0, -sticky=>"news", -columnspan=>7, -rowspan=>19] $AFScroller->{LogScroller} = MW->Scrolled(@CreateOptions);# this is the object to scrolled widget $AFScroller->{LogScroller}->grid(@PackOptions); # code where new thread is created and scrolled widget object is used to add event sub Activate { my $EventQueueTread = Thread->new(\&MonitorEventQueue, ($self, $Id)); $EventQueueTread->detach; $AFScroller->{'LogScroller'}->insert('end',"xxx yyyyy"); $AFScroller->{'LogScroller'}->see('end'); $AFScroller->{'LogScroller'}->update; # do other stuff return 1; } sub MonitorEventQueue { START: $newevent = Checkeventqueue(); if ($newevent){ $AFScroller->{'LogScroller'}->insert('end',"$newevent");# this is when application dies $AFScroller->{'LogScroller'}->see('end'); $AFScroller->{'LogScroller'}->update; } sleep 1; goto START; }