uifigure alternatives for gcf, gcbf, gco, gcbo, gca, and any other legacy figure based functions

14 次查看(过去 30 天)
Hello, I was wondering if any alternatives that work with the new uifigure windows are being developed for gcf, gcbf, gco, gcbo, gca, and any other legacy functions that used to work with legacy figures (guihandles, for example).

回答(1 个)

Walter Roberson
Walter Roberson 2023-6-2
I used to think that those functions simplify didn't apply to uifigure and children. However someone indicated that the real issue is that by default handle visibility is off for those, and that if you turn handle visibility on that the functions will work. I have not tested this.
  1 个评论
Abdou
Abdou 2024-8-1,16:22
编辑:Abdou 2024-8-1,16:27
That's true! I tested it and it works:
>> fig = uifigure(HandleVisibility = 'on'), f = gcf
fig =
Figure with properties:
Number: []
Name: ''
Color: [0.9400 0.9400 0.9400]
Position: [680 458 560 420]
Units: 'pixels'
f =
Figure with properties:
Number: []
Name: ''
Color: [0.9400 0.9400 0.9400]
Position: [680 458 560 420]
Units: 'pixels'
The default value of HandleVisibility property of a uifigure is set to 'off' to prevent the Figure object from becoming the current figure (gcf) and to prevent functions from making unwanted changes to the UI. MATLAB defaults to using the gcf or gca functions to get the target object for an operation, but these functions depend on the HandleVisibility property of the parent figure being 'on'.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by