Guihandles changes since matlab 2016?
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
Hey guys,
I am working with Matlab 2018b and trying to run an older code written in Matlab2016b and it doesn't run as it should.
The code itself creates a Gui and instead of showing me the complete Gui with buttons it shows me only the background. I was wondering if something maybe changed in the newest version of matlab. Can anyone help?
Here the code:
function RosGui()
MainFigure = figure('NumberTitle','off','Name','Super Combi Tool','Visible','on','Position',[1,1,1320,762],...
'Units','pixels','Color','k'); %,'ToolBar','none','MenuBar','none'
MainGui = guihandles(MainFigure);
initbuttonimg = imread('Grafiken/InitButton.png');
MainGui.initbutton = uicontrol('Style','pushbutton','Units','pixels','Position',[21,690,117,50],'FontSize',16,'CData',initbuttonimg);
viewbuttonimg = imread('Grafiken/ViewButton.png');
MainGui.viewbutton = uicontrol('Style','pushbutton','Units','pixels','Position',[153,690,48,50],'FontSize',16,'Enable','inactive','CData',viewbuttonimg);
developmentbuttonimg = imread('Grafiken/DevelopmentButtong.png');
MainGui.developmentbutton = uicontrol('Style','pushbutton','Units','pixels','Position',[213,690,135,50],'FontSize',16,'Enable','inactive','CData',developmentbuttonimg);
startbuttonimg = imread('Grafiken/StartButton.png');
MainGui.startstopbutton = uicontrol('Style','pushbutton','Units','pixels','Position',[794,690,48,50],'CData',startbuttonimg,'FontSize',16,'Enable','inactive');
stopbuttonimg = imread('Grafiken/StopButton.png');
MainGui.stopbutton = uicontrol('Style','pushbutton','Units','pixels','Position',[866,690,48,50],'CData',stopbuttonimg,'FontSize',16,'Enable','inactive');
savebuttonimg = imread('Grafiken/savebutton.png');
MainGui.savebutton = uicontrol('Style','pushbutton','Units','pixels','Position',[929,690,48,50],'CData',savebuttonimg,'FontSize',16,'Enable','inactive');
resetbuttonimg = imread('Grafiken/reset.png');
MainGui.resetbutton = uicontrol('Style','pushbutton','Units','pixels','Position',[992,690,48,50],'CData',resetbuttonimg,'FontSize',16,'Enable','inactive');
MainGui.startcover = axes('Units','pixels','Position',[20,20,1280,660]);
% Startcover initialisieren
start_figure = imread('Grafiken/start_cover.png');
imshow(start_figure,'Parent',MainGui.startcover);
% GuiData speichern
guidata(MainFigure,MainGui);
set(MainFigure,'Visible','on');
end
4 comentarios
Geoff Hayes
el 24 de Abr. de 2020
Ottavia - what happens if you step through the code with the MATLAB debugger? Are there any errors in the console logs?
Walter Roberson
el 24 de Abr. de 2020
search Answers for tag:always-parent
Ottavia Rossini
el 27 de Abr. de 2020
Walter Roberson
el 27 de Abr. de 2020
also if you happen to be using a high resolution display on Mac or Windows, then the meaning of pixels units changed from physical to 1/72 inch or 1/100 inch (like the "points" unit)
Respuestas (0)
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!