Problem with uipanel GUi matlab

6 vues (au cours des 30 derniers jours)
Mary Caroline
Mary Caroline le 26 Fév 2014
Commenté : Mary Caroline le 26 Fév 2014
Hi there !
I am a problem which is starting to get on my nerve but can't find a solution. I created a GUI that works perfectly. ~ When I process it, I have a panel that shows at the button ( not entirely on the window, just the top of it). When I go into my GUI figure, it's not there.
So basically I have a " phantom panel" which I would like to delete, but does not appear in my GUI Figure.
Is there a command to list all panels created in the GUI figure, or something similar to this?
Thanks
  2 commentaires
David Sanchez
David Sanchez le 26 Fév 2014
Depending on how yo created your GUI you can see the handles of the objects in it. Could you attach the *.fig and *.m file of your GUI? I could take a look
Mary Caroline
Mary Caroline le 26 Fév 2014
First of all, thanks for your help. The file is very big and has plenty of function. Here are snapshots of the user-interface, and the gui figure. ( for info, I extended the size of the GUI figure to make sure nothing was present at the bottom of the figure).
I have created my GUI using the GUIDE. The thing that I don't understand is that the panels are not seen directly in the .m. I have always created/changed them from the Gui interface.

Connectez-vous pour commenter.

Réponse acceptée

David Sanchez
David Sanchez le 26 Fév 2014
That "panel" string is associated with the bottom left panel called "Change of values". Delete it and rebuilt it again. Besides that, as I mentioned in the comment above, the whole GUI seems to have several hidden object under visible objects. That's why the images you presented above do not match (see for example the 4 push buttons in the main panel of the GUIDE in contrast with the 5 in the interface, all with no matching names). Depending on the hierarchy set when building the GUI, some objects are visible when the gui is run instead of those visible when the *.fig is opened in GUIDE mode. If I were you, I would revise the whole gui. As I said previously, there seem to be several panels on top of each other, are they of any use to you?
  3 commentaires
David Sanchez
David Sanchez le 26 Fév 2014
I played around with your gui and when you delete the panel I mentioned previously ("Change of values"), that "panel" sign doesn't show up. Somehow you manage to add it there. The easiest way to get rid of it will be to delete that small panel and create it again from scratch. Make sure on every step things go as expected.
Mary Caroline
Mary Caroline le 26 Fév 2014
The magic of programming ^^ Thanks for that. I think that this is the right solution as well.

Connectez-vous pour commenter.

Plus de réponses (2)

David Sanchez
David Sanchez le 26 Fév 2014
In the GUIDE, expand the area of your GUI downwards and eastwards. Move the "Change of values" panel too. Click on the place where the ghost panel should be and make sure it is not there. Try also to select all "Ctrl+A" and make sure than it is highlighted only those objects visible in the final interface. You can attach the *.fig if the problem persists.
  1 commentaire
Mary Caroline
Mary Caroline le 26 Fév 2014
David, I have already tried these, without success. Here is my .fig

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 26 Fév 2014
You most likely have some code in the OpeninfFcn() like this:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
That sets the size to the full screen but does not take into account that you have a task bar set to be always on top. Change your position to be something less than full screen, like this:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0.1 1 0.9]);
Make sure that the Units property of all your controls is set to "normalized".
  2 commentaires
Mary Caroline
Mary Caroline le 26 Fév 2014
I checked my opening function, and it only has things I put deliberately in there. I used it to initialise values and set the panels visibility. For info panels 3 and 4 are the bottom rectangle ( 2 panels that overlay to act as tabs) and same for 1 and 2 which are the main rectangle with the axes. The panel 20 is for the radiobutton in the "change of values" panels.
The code of the opening function:
function interface_cmb_integration_try1_OpeningFcn(hObject, eventdata, handles, varargin)
% Choose default command line output for mygui
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
set(handles.uipanel20,'SelectedObject',[])
set(handles.uipanel2, 'Visible','off');
set(handles.uipanel1, 'Visible','on');
set(handles.uipanel3, 'Visible','on');
set(handles.uipanel4, 'Visible','off');
set(handles.button_target,'Visible','off');
set(handles.pushbutton_save_toti,'Visible','off');
set(handles.pushbutton_save_totm,'Visible','off');
set(handles.pushbutton_save_2D,'Visible','off');
set(handles.pushbutton_save_list,'Visible','off');
conditions_changed=[];
assignin('base','conditions_changed',conditions_changed);
level_changed=[];
assignin('base','level_changed',level_changed);
origin_change=[];
assignin('base','origin_change',origin_change);
cas_2D=0;
assignin('base','cas',cas_2D);
set(handles.pushbutton_result,'BackgroundColor',[.75 .75 .75]);
set(handles.pushbutton_control,'BackgroundColor',[.9 .9 .9]);
David Sanchez
David Sanchez le 26 Fév 2014
I checked your GUI. Did you realize there is a hidden panel behind the panel containing the 6 axis? Did you make this GUI or was it given to you like this? It seems that this gui is built on top of another one and is showing objects from both.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by