{
  "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": "gui",
  "id": "messagebox"
}