Search code examples
matlabmatlab-figure

How to get tag of an open default Warning-Dialog (warndlg) in MATLAB?


Assume I have created a basic Warning-Dialog like:

warndlg('Some Message')

without assigning a handle. However I would like to get the handle by finding it like this:

handle_to_warndlg = findall(0,'Type','Figure','Tag','XXX');

But I do not know the the default 'Tag', 'XXX' assigned by MATLAB to the figure.

What string do I need to replace 'XXX' with?


Solution

  • On R2016b the default tag seems to be 'Msgbox_Warning Dialog'.

    Check yourself with

    h = warndlg('Some Message');
    get(h, 'Tag')