function [copyBufferFig, copyBufferAx] = getcopybuffer(varargin)
%GETCOPYBUFFER
%   [copyBufferFig, copyBufferAx] = getcopybuffer
%       returns the scribe copy buffer figure and axis,
%       creating them if they do not already exist.
%   [copyBufferFig, copyBufferAx] = getcopybuffer('noforce')
%       does not force the creation of a copy buffer figure if
%       none currently exists.

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.5 $  $Date: 1998/08/17 21:23:59 $


copyBufferFig = findobj(allchild(0),'flat',...
        'Tag','ScribeCopyBufferFig');
copyBufferAx = findobj(allchild(copyBufferFig),'flat',...
        'Tag','ScribeCopyBufferOverlayAxes');

if nargin==0 & isempty(copyBufferAx)
   copyBufferFig = figure('Tag','ScribeCopyBufferFig',...
           'IntegerHandle','off',...
           'HandleVisibility','off',...
           'NumberTitle','off',...
           'Visible','off',...           
           'Name','Scribe Copy Buffer',...
           'Resize','off');
   copyBufferAx = axes('Tag','ScribeCopyBufferOverlayAxes',...
           'HandleVisibility','off',...
           'Visible','off',...
           'Parent',copyBufferFig);
   fh = scribehandle(figobj(copyBufferFig));
end

