Matlab2018b on Linux / figure vs uifigure

3 ビュー (過去 30 日間)
Robert Schäfer
Robert Schäfer 2020 年 6 月 22 日
回答済み: Robert Schäfer 2020 年 7 月 24 日
Hi,
I created a data plotting class/app (based on uifigure and other ui components, not via the app designer) on a Win10 machine (ML2019b). Now when trying to run this on linux, the uifigure won't open (a regular figure() opens however).
Output:
>>fig2 = uifigure('Name','test2')
fig2 =
Figure (test2) with properties:
Number: []
Name: 'test2'
Color: [0.9400 0.9400 0.9400]
Position: [1000 918 560 420]
Units: 'pixels'
Show all properties
User abort via ctrl+C
General Error occurred
Unable to display properties for variable fig2 because it refers to a deleted object.
Can anyone help me?
Cheers,
Robert
  1 件のコメント
Robert Schäfer
Robert Schäfer 2020 年 6 月 25 日
I narrowed it down to:
In uifigure.m:
% Call the uifigureImpl function to create the uifigure
window = matlab.ui.internal.uifigureImpl(varargin{:});
Where again in uifigureImpl.m:
% internal implementation of uifigure creation
% Copyright 2017 The MathWorks, Inc.
nargoutchk(0,1);
controllerInfo.ControllerClassName = 'matlab.ui.internal.controller.FigureController';
% Create the uifigure, configured for app building
% Set defaults for unsupported properties first.
% After setting ControllerInfo, unsupported property sets will error.
window = appwindowfactory('WindowStyle','normal',...
'DockControls','off',...
'HandleVisibility','off',...
'IntegerHandle','off',...
'MenuBar','none',...
'NumberTitle','off',...
'Toolbar','none',...
'ControllerInfo',controllerInfo,...
'AutoResizeChildren', 'on',...
varargin{:});
% configure the new figure for application building
matlab.ui.internal.FigureServices.configureFigureForAppBuilding(window);
if (nargout > 0)
varargout{1} = window;
end
The line that causes this "stuck" issue is the controller info. Someone who could explain?

サインインしてコメントする。

回答 (2 件)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2020 年 7 月 24 日
Hi,
Figures created using 'uifigure' can be opened without any issue irrespective of the platform. You might be trying to view the figure after you have actually closed it once using the close button on the top right corner of the figure. Even the error message shows that you are trying to refer to a deleted object. Try to ensure that the handle is not deleted before you open it.

Robert Schäfer
Robert Schäfer 2020 年 7 月 24 日
Thanks for the answer. The uifigure doesn't even open.
Well I guess it's another problem then, maybe because of doing "my Windows machine -> remote desktop to a Linux machine -> SSH to another Linux machine -> starting Matlab" ...

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by