let callbacks ?(defs=false) ?(zones=false) ?(scope=false) ?(pscope=false)
    main_ui (kf, stmt, localizable) = 
  let compute f arg =

    let msg = f kf stmt arg in

    if msg <> "" then add_msg main_ui msg
  in
  let set_txt x =
    let txt = Pretty_utils.sfprintf 
      "[dependencies] for %s before stmt %d in %a"
      x stmt.sid Kernel_function.pretty_name kf 
    in 
    DpdsState.set (kf, stmt, txt);
    add_msg main_ui txt
  in
  let _ = 
    if pscope then begin
      reset ();
      match get_annot_opt localizable with
      | Some ({annot_content = (AAssert _)} as annot) ->
          begin
            set_txt ("annotation "^(string_of_int annot.annot_id));
            compute Pscope.compute annot 
          end
      | _ -> ()
    end
    else begin 
      Pscope.clear ();
      match get_lval_opt main_ui (Some(kf, stmt)) localizable with
      | None -> reset ()
      | Some (lval_txt, lval) ->
          begin
            set_txt lval_txt;
            if defs then compute ShowDef.compute lval else ShowDef.clear ();
            if zones then compute Zones.compute lval else Zones.clear ();
            if scope then compute DataScope.compute lval else DataScope.clear ()
          end
    end
  in main_ui#rehighlight ()