Why the panel was not Visible??
Afficher commentaires plus anciens
I write this code inside callback function in guide pushbutton, to create programatical panel, but it was not visible. The code excute without any error.
% --- Executes on button press in bright.
function bright_Callback(hObject, eventdata, handles)
% hObject handle to bright (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%create new Panel for Brightness, Contrast, Resolution.
global stat
stat = 0;
figure1 = findobj('Tag','figure1');
brightPanel = uipanel('Parent',figure1,'Title','Sitting',...
'Position',[83, 118, 250, 400],...
'Tag','BrightPanel');
set(brightPanel,'Visible','off');
brightText = uicontrol(brightPanel,'Style','text',...
'String','Brightness',...
'Position',[50, 327, 82, 25]);
brightValueEdit = uicontrol(brightPanel,'Style','edit',...
'String','',...
'Tag','BVEdit',...
'Position',[143, 327, 40, 25]);
brightValueSlider = uicontrol(brightPanel,'Style','slider',...
'String','',...
'Tag','BVSlider',...
'Max',100,'Min',-100,'Value',0,...
'SliderStep',[1 5],...
'Position',[55, 283, 140, 18]);
set(brightPanel,'Visible','on');
set(handles.back2mainMenu,'Visible','on');
set(handles.mainMenu,'Visible','off');
PS: the mainMenu was hide and back2mainMenu puchbutton was shwo.
Réponses (2)
Walter Roberson
le 22 Déc 2016
1 vote
One possibility is that the panel might be behind another panel or axes. Starting in R2014b, uicontrols and uipanel no longer automatically appear on top when they are visible; if something else covers them up then they will not be visible.
6 commentaires
hassan sb
le 23 Déc 2016
Walter Roberson
le 23 Déc 2016
uistack() the uipanel
hassan sb
le 23 Déc 2016
Walter Roberson
le 23 Déc 2016
Please attach your code and your .fig
hassan sb
le 23 Déc 2016
Merse Gaspar
le 6 Juin 2023
But how to set the order?
Image Analyst
le 23 Déc 2016
1 vote
You're using GUIDE so why not just place the panels in GUIDE? Why go to all the tedious trouble to create panels from scratch? For example if your figure units were 'normalized' and your panel units are in 'pixels' then your panels might be off the screen. Make it easy for yourself and just put the panels on there with GUIDE. I mean you're already using GUIDE so why not?
3 commentaires
hassan sb
le 23 Déc 2016
Image Analyst
le 23 Déc 2016
You can do it. Just put all the panels up the, put your controls into them. then arrange your panels, overlapping them if wanted. Then just set visibility in your code. But you don't need to recreate them in code, just set their visibility.
hassan sb
le 23 Déc 2016
Catégories
En savoir plus sur Subplots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!