Create a simple gui with a list and an axes without GUIDE

조회 수: 2 (최근 30일)
Patrik Ek
Patrik Ek 2014년 8월 13일
답변: Patrik Ek 2014년 8월 13일
Hi, guide is an excellent way to create a gui i matlab, but due to the large amount of code generated it get a bit slow and also takes some time to start up. That is why I want to create a simpler gui, not using all the functionality of a gui created in guide, but only the properties of a default figure. What I need is a listdlg, a inputdlg and an axes.
This have nothing to do with the problem but is a motivation to why I need this. I create a colorbar for an external application. This is not a matlab colorbar, but rather a plot creates to look like a colorbar. Everytime I select an option I want the colorbar to update. Then when the figure closes I want to pass the colormap to the next scope (or save it or create the colorbar and save as image or whatever I find feasible. This is easy anyway, just customize the closeRequestFcn).
The problem is assigning dialogue boxes to the figure. It feels like this have to be done when the dialogue box is created, but I have no idea how. I guess it must be som ui... command for this, but I do not know which. I am not so used to gui yet. So please, if someone know how to create a dialogue box and assign it to a gui I would appreciate the help.
  댓글 수: 3
Patrik Ek
Patrik Ek 2014년 8월 13일
편집: Patrik Ek 2014년 8월 13일
I do not really need to. It would be even better if I could have it as stand alone.However, I do not want it to close after use, since I need to use it multiple times. Also it would work with only an inputdlg I think.
Joakim Magnusson
Joakim Magnusson 2014년 8월 13일
It sounds unnecessary to use dialog boxes that way, guide shouldn't be that slow.

댓글을 달려면 로그인하십시오.

채택된 답변

Patrik Ek
Patrik Ek 2014년 8월 13일
I have been trying a little and found out a way to do this. I found that the function to use is uicontrol
figure
hax = axes('Units','pixels');
surf(peaks)
uicontrol('Style', 'listbox',...
'String', {'jet','hsv','hot','cool','gray'},...
'Position', [20 340 100 50],...
'Callback', @myCallback);
Actually a listbox is what need to be used here since this have gui support.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by