uifigure alternatives for gcf, gcbf, gco, gcbo, gca, and any other legacy figure based functions
9 views (last 30 days)
Show older comments
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).
0 Comments
Answers (1)
Walter Roberson
on 2 Jun 2023
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 Comment
Abdou
on 1 Aug 2024
Edited: Abdou
on 1 Aug 2024
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'.
See Also
Categories
Find more on Develop uifigure-Based Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!