{
  "name": "MessageBox",
  "component": "gui",
  "header": "nativeui/message_box.h",
  "type": "Class",
  "namespace": "nu",
  "description": "A window showing some text and buttons.",
  "class_methods": [
    {
      "signature": {
        "returnType": {
          "name": "MessageBox",
          "id": "messagebox"
        },
        "name": "create",
        "parameters": [],
        "shortStr": "create()",
        "str": "create()"
      },
      "description": "Create a message box.",
      "id": "create"
    }
  ],
  "methods": [
    {
      "signature": {
        "returnType": {
          "name": "integer"
        },
        "name": "run",
        "parameters": [],
        "shortStr": "run()",
        "str": "run()"
      },
      "description": "Show the message box and wait for result. Response ID will be returned.\n",
      "id": "run"
    },
    {
      "signature": {
        "returnType": {
          "name": "integer"
        },
        "name": "runforwindow",
        "parameters": [
          {
            "type": {
              "name": "Window",
              "id": "window"
            },
            "name": "window"
          }
        ],
        "shortStr": "runforwindow(window)",
        "str": "runforwindow(window)"
      },
      "description": "Show the message box as a child for `window` and wait for result.\nResponse ID will be returned.\n",
      "id": "runforwindow-window"
    },
    {
      "signature": {
        "name": "show",
        "parameters": [],
        "shortStr": "show()",
        "str": "show()"
      },
      "platform": [
        "Windows",
        "Linux"
      ],
      "description": "Show the message box. The `<!name>on_response` event will be emitted when\nthe message box is closed.\n",
      "id": "show"
    },
    {
      "signature": {
        "name": "showforwindow",
        "parameters": [
          {
            "type": {
              "name": "Window",
              "id": "window"
            },
            "name": "window"
          }
        ],
        "shortStr": "showforwindow(window)",
        "str": "showforwindow(window)"
      },
      "description": "Show the message box as a child of `window`. The `<!name>on_response`\nevent will be emitted when the message box is closed.\n",
      "id": "showforwindow-window"
    },
    {
      "signature": {
        "name": "close",
        "parameters": [],
        "shortStr": "close()",
        "str": "close()"
      },
      "description": "Close the message box. The cancel response ID will be used as result.\n",
      "id": "close"
    },
    {
      "signature": {
        "name": "settype",
        "parameters": [
          {
            "type": {
              "name": "MessageBox::Type",
              "id": "messagebox_type"
            },
            "name": "type"
          }
        ],
        "shortStr": "settype(type)",
        "str": "settype(type)"
      },
      "description": "Set the `type` of message box, system will show the corresponding icon in\nthe message box.\n",
      "detail": "On macOS there is no visual difference between `information` and `warning`\ntypes.\nOn Linux this method has no effect if a custom icon has been set.\n",
      "id": "settype-type"
    },
    {
      "signature": {
        "name": "settitle",
        "parameters": [
          {
            "type": {
              "name": "string"
            },
            "name": "title"
          }
        ],
        "shortStr": "settitle(title)",
        "str": "settitle(title)"
      },
      "platform": [
        "Windows",
        "Linux"
      ],
      "description": "Set the message box window's title.",
      "id": "settitle-title"
    },
    {
      "signature": {
        "name": "addbutton",
        "parameters": [
          {
            "type": {
              "name": "string"
            },
            "name": "title"
          },
          {
            "type": {
              "name": "integer"
            },
            "name": "response"
          }
        ],
        "shortStr": "addbutton(title, response)",
        "str": "addbutton(title, response)"
      },
      "description": "Add a button with `title`. The `response` ID will be used as result when\nthe button is clicked.\n",
      "id": "addbutton-title-response"
    },
    {
      "signature": {
        "name": "setdefaultresponse",
        "parameters": [
          {
            "type": {
              "name": "integer"
            },
            "name": "response"
          }
        ],
        "shortStr": "setdefaultresponse(response)",
        "str": "setdefaultresponse(response)"
      },
      "description": "Set the default `response` ID, when user presses the <kbd>Enter</kbd> key\nthe button associated with the ID will be clicked.\n",
      "id": "setdefaultresponse-response"
    },
    {
      "signature": {
        "name": "setcancelresponse",
        "parameters": [
          {
            "type": {
              "name": "integer"
            },
            "name": "response"
          }
        ],
        "shortStr": "setcancelresponse(response)",
        "str": "setcancelresponse(response)"
      },
      "description": "Set the cancel `response` ID that will be used as result  when user\npresses the <kbd>Esc</kbd> key or when the window is closed without\nclicking any button.\n",
      "detail": "The default cancel response ID is -1.",
      "id": "setcancelresponse-response"
    },
    {
      "signature": {
        "name": "settext",
        "parameters": [
          {
            "type": {
              "name": "string"
            },
            "name": "text"
          }
        ],
        "shortStr": "settext(text)",
        "str": "settext(text)"
      },
      "description": "Set the message box's message text.",
      "id": "settext-text"
    },
    {
      "signature": {
        "name": "setinformativetext",
        "parameters": [
          {
            "type": {
              "name": "string"
            },
            "name": "text"
          }
        ],
        "shortStr": "setinformativetext(text)",
        "str": "setinformativetext(text)"
      },
      "description": "Set informative text that will show bellow the message text.",
      "id": "setinformativetext-text"
    },
    {
      "signature": {
        "name": "setaccessoryview",
        "parameters": [
          {
            "type": {
              "name": "View",
              "id": "view"
            },
            "name": "view"
          }
        ],
        "shortStr": "setaccessoryview(view)",
        "str": "setaccessoryview(view)"
      },
      "platform": [
        "macOS",
        "Linux"
      ],
      "description": "Set the accessory `view` that will be placed between the text and the\nbuttons. The `view` must be given a size before being used as accessory\nview.\n",
      "id": "setaccessoryview-view"
    },
    {
      "signature": {
        "returnType": {
          "name": "View",
          "id": "view"
        },
        "name": "getaccessoryview",
        "parameters": [],
        "shortStr": "getaccessoryview()",
        "str": "getaccessoryview()"
      },
      "platform": [
        "macOS",
        "Linux"
      ],
      "description": "Return the accessory view.",
      "id": "getaccessoryview"
    },
    {
      "signature": {
        "name": "setimage",
        "parameters": [
          {
            "type": {
              "name": "Image",
              "id": "image"
            },
            "name": "image"
          }
        ],
        "shortStr": "setimage(image)",
        "str": "setimage(image)"
      },
      "description": "Set the custom icon displayed in the message box.",
      "detail": "On macOS the default icon is the app's icon, on Windows and Linux there\nis no default icon.\n",
      "id": "setimage-image"
    },
    {
      "signature": {
        "returnType": {
          "name": "Image",
          "id": "image"
        },
        "name": "getimage",
        "parameters": [],
        "shortStr": "getimage()",
        "str": "getimage()"
      },
      "description": "Return the custom icon.",
      "id": "getimage"
    }
  ],
  "events": [
    {
      "signature": {
        "name": "onresponse",
        "parameters": [
          {
            "type": {
              "name": "MessageBox",
              "id": "messagebox"
            },
            "name": "self"
          },
          {
            "type": {
              "name": "integer"
            },
            "name": "response"
          }
        ],
        "shortStr": "onresponse(self, response)",
        "str": "onresponse(self, response)"
      },
      "description": "Emitted when the message box is closed.",
      "id": "onresponse-self-response"
    }
  ],
  "module": "yue.gui",
  "id": "messagebox"
}