> For the complete documentation index, see [llms.txt](https://vuido.mimec.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vuido.mimec.org/usage/displaying-dialogs.md).

# Displaying Dialogs

## Message Boxes

You can use the `$dialogs.msgBox()` method to display a simple message box with an OK button. The first parameter is the title of the dialog and the second parameter is the message text. For example:

```markup
<template>
  <Window title="Example" width="400" height="100" margined>
    <Button v-on:click="showMessage">Show Message</Button>
  </Window>
</template>

<script>
export default {
  methods: {
    showMessage() {
      this.$dialogs.msgBox( 'Title', 'This is the message.' );
    }
  }
}
</script>
```

You can also use the `$dialogs.msgBoxError()` method to display an error message. It has the same parameters as `msgBox()`.

## File Dialogs

You can use the `$dialogs.openFile()` method to allow the user to select an existing file or `$dialogs.saveFile()` to prompt for a new file to be created or overwritten. Both these methods return the path of the selected file or null if the user cancelled the operation. For example:

```markup
<template>
  <Window title="Example" width="400" height="100" margined>
    <Button v-on:click="openFile">Open File</Button>
  </Window>
</template>

<script>
export default {
  methods: {
    openFile() {
      const filePath = this.$dialogs.openFile();
      if ( filePath != null ) {
        // do something...
      }
    }
  }
}
</script>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vuido.mimec.org/usage/displaying-dialogs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
