anchor.diff:                              Opt1 = Opt0#opt{type=ets},
                               {get_tables(Node, Opt1), Opt1}
                       end,
  -    Tabs = update_grid(Grid, Opt, Tables),
  +    {Tabs,Sel} = update_grid(Grid, sel(State), Opt, Tables),
       wxWindow:setFocus(Grid),
       create_menus(Parent, Opt),
       Timer = observer_lib:start_timer(Timer0),
  -    {noreply, State#state{node=Node, tabs=Tabs, timer=Timer, opt=Opt}};
  +    {noreply, State#state{node=Node, tabs=Tabs, timer=Timer, opt=Opt, selected=Sel}};
   
   handle_info(not_active, State = #state{timer = Timer0}) ->
       Timer = observer_lib:stop_timer(Timer0),
  
positive.code: list_to_strings([A|B]) ->
      integer_to_list(A) ++ " ," ++ list_to_strings(B).
  
  update_grid(Grid, Opt, Tables) ->
      wx:batch(fun() -> update_grid2(Grid, Opt, Tables) end).
  update_grid2(Grid, #opt{sort_key=Sort,sort_incr=Dir}, Tables) ->
      wxListCtrl:deleteAllItems(Grid),
      Update =
  	fun(#tab{name = Name, id = Id, owner = Owner, size = Size, memory = Memory,
  		 protection = Protection, reg_name = RegName}, Row) ->
  		_Item = wxListCtrl:insertItem(Grid, Row, ""),
  		if (Row rem 2) =:= 0 ->
  			wxListCtrl:setItemBackgroundColour(Grid, Row, ?BG_EVEN);
  
negative.code: 			      end,
  			      [{0,Name}, {1,Size}, {2, Memory div 1024},
  			       {3,Owner}, {4,RegName}, {5,Id}]),
                  if SelName =:= Name, SelId =:= Id ->
                          wxListCtrl:setItemState(Grid, Row, 16#FFFF, ?wxLIST_STATE_SELECTED),
                          {Row+1, Row};
                     true ->
                          wxListCtrl:setItemState(Grid, Row, 0, ?wxLIST_STATE_SELECTED),
                          {Row+1, Sel}
                  end
  	end,
      ProcInfo = case Dir of
  		   false -> lists:reverse(lists:keysort(Sort, Tables));
  		   true -> lists:keysort(Sort, Tables)
  	       end,
      {_, Sel} = lists:foldl(Update, {0, undefined}, ProcInfo),
      {ProcInfo, Sel}.
  
  sel(#state{selected=Sel, tabs=Tabs}) ->
      try lists:nth(Sel+1, Tabs) of
          #tab{name=Name, id=Id} -> {Name, Id}
      catch _:_ ->
              {undefined, undefined}
      end.
  