\HeaderA{getMVCFromWinNum}{Returns the MVC object that the view with focus belongs to}{getMVCFromWinNum}
\keyword{data}{getMVCFromWinNum}
\begin{Description}\relax
Each view belongs to a MVC object.  This function takes the active window
number, which is stored in the environment variable activeWinNum in mvcEnv,
and returns the MVC object that this view belongs to.  This function is
needed when the callback function needs to determine which MVC to update
after user interaction with a view.  Note: the device number can't be used
to determine the active view, because not all views have a device
(ex. spreadsheet).
\end{Description}
\begin{Usage}
\begin{verbatim}
getMVCFromWinNum()
\end{verbatim}
\end{Usage}
\begin{Details}\relax
Initially, the user could only interact with views of the active MVC, but
now the user can interact with any view.  Thus, this function is called by
all callback functions to determine which MVC should be updated in response
to user interaction with the view with focus.
\end{Details}
\begin{Value}
Returns the MVC object that the view (as represented by the active window
number) belongs to.  If no MVC object can be found that corresponds with
the view, then the active MVC object is returned.
\end{Value}
\begin{Author}\relax
Elizabeth Whalen
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{addCBFunction}{addCBFunction}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  if (interactive())
  {
    loadData("USArrests")
    setActiveMVC("USArrests")
    createSPlot(varx="Murder", vary="Assault")
    curMVC<-getMVCFromWinNum()
  } 
\end{ExampleCode}
\end{Examples}

