function fig_hdl = gh_build % GH_BUILD %------------------------------------------------------------------------------- % File name : gh_build.m % Generated on: 06-Apr-2013 08:29:27 % Description : %------------------------------------------------------------------------------- % --- FIGURE ------------------------------------- handles.figure1 = figure( 'Tag', 'figure1', ... 'Units', 'characters', ... 'Position', [103.8 22.3076923076923 112 32.0769230769231], ... 'Name', 'gh', ... 'MenuBar', 'none', ... 'NumberTitle', 'off', ... 'Color', get(0,'DefaultUicontrolBackgroundColor')); % --- SLIDERS ------------------------------------- handles.slider1 = uicontrol( 'Parent', handles.figure1, ... 'Tag', 'slider1', ... 'UserData', [], ... 'Style', 'slider', ... 'Units', 'characters', ... 'Position', [5.4 27.2307692307692 78.8 1.30769230769231], ... 'BackgroundColor', [0.478 0.0627 0.894], ... 'String', {'Slider'}, ... 'SliderStep', [0.1 0.1], ... 'Callback', @slider1_Callback, ... 'CreateFcn', @slider1_CreateFcn); % Save handles structure guidata(handles.figure1,handles); % Assign function output fig_hdl = handles.figure1; %------------------------------------------------------------------------------- function slider1_Callback(hObject,evendata) persistent c if isempty(c) c=0; movegui('center') end a=get(handles.slider1,'value'); b=get(handles.figure1,'position'); set(handles.figure1,'position',[b(1) b(2) b(3)+(a-c)*20 b(4)+(a-c)*20]) c=a movegui('center') end %------------------------------------------------------------------------------- function slider1_CreateFcn(hObject,evendata) end end