Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help - ListBox Modification

Status
Not open for further replies.

greavesm

Programmer
Mar 14, 2004
6
GB
Hello,

I have got a Normal Listbox that I want to replace the values in when I recieve an SNMP trap, I can get the trap but I cannot for the life of me find any info on how to change a value in a list box without first deleting it. The program I am writing has several threads and I have got it to auto update the GUI periodically so it would be able to detect a change in the listbox and update accordingly.

The problem with deleting it first its that it tends to tie the GUI up a lot more than I can put up with as need it to refresh at a very regular rate!!

Thanks

Mark Greaves
 
I am using TK, see example code:

$listboxes = [ $first = $mw->Listbox(),
$second = $mw->Listbox(),
$third = $mw->Listbox(),
$fourth = $mw->Listbox() ];
foreach $list (@$listboxes) {
$list->configure(-height=>25, -yscrollcommand =>
[\&scroll_listboxes, $scroll,$list, $listboxes ]);
}
$scroll->configure(-command => sub {
foreach $list (@$listboxes) {
$list->yview(@_);
}
});

This is basiccally an array of 4 listboxes which are configured to move with a single scroll bar at the side, I want to add an Icon to the fourth listbox. This ia basically a monitoring program for a network of telecoms equipment using SNMP, the listboxes contain the details of the network elements (ip addresses, NE type, Ne Name), when I recieve a trap I want to change a tick icon in the fourth box to a cross icon showing the user where the problem is. Origional Idea was to change the colour of a listbox item to show the alarm but cannot figure out a way to do that either. Icon is the only other way I can think of.

Is this enough info???

Thanks

mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top