> For the complete documentation index, see [llms.txt](https://sakura-9.gitbook.io/sakura/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sakura-9.gitbook.io/sakura/information/examples/rendering-menus-windows.md).

# Rendering menus, windows

Pseudocodes to use of rendering menu / window.

You should also check the [Hooks](/sakura/documentation/hooks.md) if you want to know more about the callbacks for you script.

<pre class="language-lua"><code class="lang-lua">-- Define a local function called "Menu"
<strong>local function Menu()
</strong><strong>	-- Call the ImGui library's Text function to display a message
</strong>	ImGui.Text("Your text in this menu")
end

-- Register the Menu function to be called when the SAKURA_MENU_RENDER hook is triggered
<strong>Hooks.Register(SAKURA_MENU_RENDER, Menu)
</strong></code></pre>

```lua
-- Define a local function called "Window"
local function Window()
	-- Call the ImGui library's Text function to display a message
	ImGui.Text("Your text inside window")
end

-- The second function, named "AtWindowRender", sets up the window using the ImGui.Window function.
local function AtWindowRender()
	-- The menu is given a title "Your window" and a reference to the "Window" callback function is passed as the second argument.
	ImGui.Window("Your window", 0, Window)
end

-- Register the Menu function to be called when the SAKURA_WINDOW_RENDER hook is triggered
Hooks.Register(SAKURA_WINDOW_RENDER, AtWindowRender)
```
