ui.dialog ================= .. py:function:: ui.dialog(widgets) *New in metview-python version 1.9.0*. Creates a popup editor from a list of widget components and returns user input. It requires the Metview user interface to be installed. :param widgets: list of widget components :rtype: dict The example below shows how :func:`ui.dialog` can be used with various widget components: .. code-block:: python import metview as mv a = mv.ui.icon( name="input data", class_="GRIB" ) b = mv.ui.any( name="verif date (yyyy-mm-dd)", default="2012-03-01", help="help_script", help_script_command="echo Dates must be in YYYY-MM-DD format" ) c = mv.ui.slider( name="days", min=1, max=10, default=5 ) d = mv.ui_option_menu( name="parameter", values=["UV", "t"], default="t" ) e = mv.ui.any( name="area", help="help_input", input_type="area", default=[30,-25,50,65] # S, W, N, E ) f = mv.ui.colour( name="isoline_colour", default="green" ) g = mv.ui.toggle( name="show_title", default="on" ) # retrieve the user input values x = mv.ui.dialog([a, b, c, d, e, f, g]) print("area=", x["area"]) The actual popup editor generated by :func:`ui.dialog` looks like this: .. image:: /_static/api/dialog_1.png :width: 320px The table below lists all the available widget components: .. list-table:: :widths: 20 80 :header-rows: 0 * - :func:`ui.any` - value input widget * - :func:`ui.colour` - colour selector widget * - :func:`ui.icon` - icon drop area widget * - :func:`ui.option_menu` - option menu (combobox) widget * - :func:`ui.slider` - slider widget * - :func:`ui.toggle` - on/off toggle button widgets .. mv-minigallery:: ui.dialog