def retval_is_code(func):
    """Decorator for :class:`Dialog` widget-producing methods whose return value is the :term:`Dialog exit code`.

    This decorator is intended for widget-producing methods whose return
    value consists solely of the Dialog exit code. When this decorator
    is *not* used on a widget-producing method, the Dialog exit code
    must be the first element of the return value.

    .. versionadded:: 3.0

    """
    func.retval_is_code = True
    return func
