hoffstadt / hoffstadt/DearPyGui

Tooltips don't work on buttons with absolute position

Open
#2,651 0 comments 0 reactions 0 assignees View on GitHub
state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

### Dear PyGui version:

2.3

### Python version:

3.13.11

### Operating system:

Windows 11

### My issue/question:

Tooltips don't work when added to buttons or image_buttons with `pos` set. Other widgets work (at least the few I tested). As a workaround the position can be set on group holding both.

### Steps to reproduce:

```python
dpg.add_button(label="pos on button", pos=(20, 20))
with dpg.tooltip(dpg.last_item()):
dpg.add_text("HELLO")
```

### Expected behavior:

Tooltip on hover. Workaround is to embed the button and tooltip in a group and set the position on the group instead.

### Screenshots:

N/A

### Standalone, minimal, complete and verifiable example:

```python
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title="Custom Title", width=600, height=600)

with dpg.window():
dpg.add_button(label="pos on button", pos=(20, 20))
with dpg.tooltip(dpg.last_item()):
dpg.add_text("HELLO")

with dpg.group(pos=(20, 60)):
dpg.add_button(label="pos on group")
with dpg.tooltip(dpg.last_item()):
dpg.add_text("HELLO")

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.