function [f,hcursor] = slidfreq(f_t,hslide,hcursor,haxis,maxto,minto,lnst,lnco)
%
%  Name:   slidfreq
%
%  Usage:  slidfreq
%
%  This m-file is used so that the sliders increment properly.
% 
%  Version SWD970401
%
%  Author(s): Phillip Cornwell, cornwell@lanl.gov
%	modified by Scott W. Doebling, doebling@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%               ESA-EA
%
%  Copyright (c) 1996-1997, The Regents of the University
%       of California. (See top level of code for
%       full copyright statement.)
%

%
%  Get maximum and minimum frequencies
%

max_f=get(hslide,'max');
min_f=get(hslide,'min');

%
%  Get vector of valid frequency bins (userdata of slider)
%

binvec = get(hslide,'userdata');

%
%  Round selected frequency to nearest frequency bin
%

[junk,j] = min(abs( binvec - f_t ));
f = binvec(j);

%
%  Set slider to the rounded frequency
%

set(hslide,'value',f);

%
%  Draw the Cursor line
%

hcursor = plotline(hcursor,haxis,f,maxto,minto,lnst,lnco);

return
