> For the complete documentation index, see [llms.txt](https://low-caps-hub.gitbook.io/lowcapshubterminal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://low-caps-hub.gitbook.io/lowcapshubterminal/initial-section/navigation-home-and-page-back.md).

# Navigation: Home and Page Back

Obviously purpose those two button is very easy to guess. However, how does it look from the technical side?

<figure><img src="/files/kxuWRlg144Gv2wYZpX2u" alt=""><figcaption></figcaption></figure>

**Home**

Function:

```python
def navigate_to(self, new_screen_func):
    self.navigation_stack.append(new_screen_func)
    new_screen_func()
```

Definition:

```python
self.home_button = customtkinter.CTkButton(
    self.bottom_frame,
    text="Home",
    command=lambda: self.navigate_to(self.show_home_screen)
)
```

\
**Page Back**

Function:

```python
def go_back(self):
    if len(self.navigation_stack) > 1:
        self.navigation_stack.pop()
        previous_screen_func = self.navigation_stack[-1]
        previous_screen_func()
    else:
        self.show_message("No previous screen to go back to.", "Navigation")
```

Definition:

```python
self.back_button = customtkinter.CTkButton(
    self.bottom_frame,
    text="Page Back",
    command=self.go_back
)
```
