GUI中Button Types and Button Group的介绍(4)

2021-09-24 13:20

%

% TEST_BUTTON_GROUP( Property ,'Value ,…) creates a new

TEST_BUTTON_GROUP or raises the

% existing singleton*. Starting from the left, property value pairs are

% applied to the GUI before test_button_group_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to test_button_group_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 test_button_group % Last Modified by GUIDE v2.5 17-Jul-2008 01:38:31

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct( gui_Name , mfilename, …

gui_Singleton , gui_Singleton, …

gui_OpeningFcn , @test_button_group_OpeningFcn, …

gui_OutputFcn , @test_button_group_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{:});

网上的对GUI控件的介绍!

else

gui_mainfcn(gui_State, varargin{:});

end

% End initialization code - DO NOT EDIT

% — Executes just before test_button_group is made visible.

function test_button_group_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 test_button_group (see VARARGIN) % Choose default command line output for test_button_group

handles.output = hObject;

% Update handles structure

set(handles.fontSelect_buttongroup, SelectionChangeFcn ,@fontSelect_buttongroup_SelectionChangeFcn);

guidata(hObject, handles);

% UIWAIT makes test_button_group wait for user response (see UIRESUME) % uiwait(handles.figure1);

% — Outputs from this function are returned to the command line.

function varargout = test_button_group_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;

function fontSelect_buttongroup_SelectionChangeFcn(hObject, eventdata) %retrieve GUI data, i.e. the handles structure

handles = guidata(hObject);

switch get(hObject, Tag ) % Get Tag of selected object

case fontsize08_radiobutton

%execute this code when fontsize08_radiobutton is selected

set(handles.display_staticText, FontSize ,8);

网上的对GUI控件的介绍!

case fontsize12_radiobutton

%execute this code when fontsize12_radiobutton is selected

set(handles.display_staticText, FontSize ,12);

case fontsize14_radiobutton

%execute this code when fontsize16_radiobutton is selected

set(handles.display_staticText, FontSize ,16);

otherwise

% Code for when there is no match. end

%updates the handles structure

guidata(hObject, handles);

Let me know please, I need to get this done!!

Thanks!

Edvier, I don t know what your error is.

In addition, we are not in the business of debugging code. You can download the source file for this GUI to troubleshoot. Maybe you didn t name your buttons correctly or set up the button panel incorrectly.

Goodluck debugging. If you have specific questions, come back and ask them! Hello, How can i increase the size of the tick in the checkbox?

Thanks,

Smith

网上的对GUI控件的介绍!

I tried to run the source code downloaded above. But there are some error occurred. The errors are as follows:

_______________________________________________________________________

There is no SelectionChangeFcn property in the uipanel class.

Error in ==> button_tutorial>button_tutorial_OpeningFcn at 58

set(handles.fontSelect_buttongroup, SelectionChangeFcn ,@fontSelect_buttongroup_SelectionChangeFcn);

Error in ==> gui_mainfcn at 166

feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ==> button_tutorial at 42

gui_mainfcn(gui_State, varargin{:});

_________________________________________________________________

______

P/S: How to solve this error?

Thanks.

Regards,

Jessie

Jessie,

Are you using an old version of MATLAB? It works fine for me on 2006 and 2007. (I assume it works on 2008 too)

Quan


GUI中Button Types and Button Group的介绍(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:带电粒子在匀强磁场中运动轨迹

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: