in reply to Re: Mlistbox Sort
in thread Mlistbox Sort

Thanks for that

ive setup the bind to the header and then sorted the array as is, this enables me to also determine the type of sort to do on each column.

code

#bind to the header column, to enable sorting and also so we can distr +oy the thread $grid->bindColumns('<Button-1>' => sub { my ($w, $infoHR) = @_; my $column = $infoHR->{-column}; #change the queue status to HOLD while any user interaction is + occuring &button_setup('HOLD','Red'); #kill current processing thread print "Thread destroyed\n"; $thr->cancel(); my @entirelist = $grid->get(0,"end"); $grid->delete(0,"end"); #sort selected column if($column =~/0|2/){ @entirelist = sort {$a->[$column] <=> $b->[$column]} @enti +relist; }else{ @entirelist = sort {lc$a->[$column] cmp lc$b->[$column]} @ +entirelist; }; &populate_grid($grid,scalar @goods_issues_headers-1,\@entireli +st); });
all I need to do now is add in reverse and its away and running.

thanks skywalker