Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to change mouse cursor in groups and buttons #2399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions dearpygui/_dearpygui.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions dearpygui/_dearpygui_RTD.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 19 additions & 6 deletions dearpygui/dearpygui.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions dearpygui/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3252,6 +3252,21 @@ def _event_handler(sender, data):
for handler in dpg.get_item_children("__demo_mouse_handler", 1):
dpg.set_item_callback(handler, _event_handler)

with dpg.tree_node(label="Mouse Cursors"):
cursors = [("Arrow", dpg.mvMouseCursor_Arrow), ("TextInput", dpg.mvMouseCursor_TextInput),
("ResizeAll", dpg.mvMouseCursor_ResizeAll), ("ResizeNS", dpg.mvMouseCursor_ResizeNS),
("ResizeEW", dpg.mvMouseCursor_ResizeEW), ("ResizeNESW", dpg.mvMouseCursor_ResizeNESW),
("ResizeNWSE", dpg.mvMouseCursor_ResizeNWSE), ("Hand", dpg.mvMouseCursor_Hand),
("NotAllowed", dpg.mvMouseCursor_NotAllowed)]
dpg.add_text("Hover to see mouse cursors:")
with dpg.tooltip(dpg.last_item()):
dpg.add_text("Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns.\n"
"If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you,\n"
"otherwise your backend needs to handle it.")
for i in range(len(cursors)):
with dpg.group(horizontal=True, cursor_on_hover=cursors[i][1]):
dpg.add_text(cursors[i][0], bullet=True)

with dpg.collapsing_header(label="Drag & Drop"):

with dpg.tree_node(label="Help"):
Expand Down
Loading
Loading