function varargout = MultilineSTdemo(varargin)
% MULTILINESTDEMO M-file for MultilineSTdemo.fig
% MULTILINESTDEMO, by itself, creates a new MULTILINESTDEMO or raises the existing
% singleton*.
%
% H = MULTILINESTDEMO returns the handle to a new MULTILINESTDEMO or the handle to
% the existing singleton*.
%
% MULTILINESTDEMO('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MULTILINESTDEMO.M with the given input arguments.
%
% MULTILINESTDEMO('Property','Value',...) creates a new MULTILINESTDEMO or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before MultilineSTdemo_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to MultilineSTdemo_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help MultilineSTdemo
% Last Modified by GUIDE v2.5 23-Nov-2009 17:04:28
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MultilineSTdemo_OpeningFcn, ...
'gui_OutputFcn', @MultilineSTdemo_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before MultilineSTdemo is made visible.
function MultilineSTdemo_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to MultilineSTdemo (see VARARGIN)
global MyStr;
MyStr = {'山居秋暝', '王维', '空山新雨后,天气晚来秋。', '明月松间照,清泉石上流。', '竹喧归浣女,莲动下渔舟。', '随意春芳歇,王孙自可留。'};
handles.timer = timer('Period',1,'ExecutionMode','FixedRate', 'TimerFcn',{@timercallback,handles});
start(handles.timer);
% Choose default command line output for MultilineSTdemo
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MultilineSTdemo wait for user response (see UIRESUME)
uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = MultilineSTdemo_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
stop(handles.timer);
delete(handles.figure1);
% --- Executes when user attempts to close figure1.
function figure1_CloseRequestFcn(hObject, eventdata, handles)
% hObject handle to figure1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: delete(hObject) closes the figure
uiresume;
function timercallback(obj, event, handles)
global MyStr;
Str1 = MyStr{1};
Str2 = MyStr{2};
Str3 = MyStr{3};
Str4 = MyStr{4};
Str5 = MyStr{5};
Str6 = MyStr{6};
MyStr = strvcat(Str2, Str3, Str4, Str5, Str6, Str1);
set(handles.text1, 'String', MyStr);
tempStr{1} = MyStr(1, :);
tempStr{2} = MyStr(2, :);
tempStr{3} = MyStr(3, :);
tempStr{4} = MyStr(4, :);
tempStr{5} = MyStr(5, :);
tempStr{6} = MyStr(6, :);
MyStr = tempStr;