Skip to content

more imgui stuff! #849

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

more imgui stuff! #849

wants to merge 8 commits into from

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Jun 1, 2025

closes #848, closes #847

@kushalkolar kushalkolar requested a review from clewis7 as a code owner June 1, 2025 00:20
Comment on lines +24 to +25
if imgui.button("reset data"):
fig_local[0, 0].graphics[0].data[:, 1] = np.random.rand(100)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be "new data" instead of "reset data"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make it more informative for what the button actually does

@clewis7
Copy link
Member

clewis7 commented Jun 2, 2025

I have never seen someone love a decorator more than you lol

@clewis7
Copy link
Member

clewis7 commented Jun 2, 2025

I think this is pretty cool

One thing, I'm not sure how I feel about the ChangeFlag class

It seems like a lot of scaffolding just to indicate that the user has interacted with the imgui window...unless I am missing something

@kushalkolar
Copy link
Member Author

kushalkolar commented Jun 2, 2025

One thing, I'm not sure how I feel about the ChangeFlag class

It seems like a lot of scaffolding just to indicate that the user has interacted with the imgui window...unless I am missing something

It's useful when you have a lot of UI elements that could have changed and you want to know if any of them have changed. It's cumbersome to write:

changed1, val1 = imgui.slider(...)
changed2, val2 = imgui.slider(...)
...
changed_n, valn = imgui.slider(...)

if any([changed1, changed2, ... change_d]):
  # recompute

# could also do
if changed1 | changed2 | ... changed_n:
  # recompute

Basically the following is invalid python syntax otherwise I would just use the or operator | with tuple unpacking:

changed |, val1 = imgui.slider(...)
changed |, val2 = imgui.slider(...)
...
changed |, val_n = imgui.slider(...)

This is valid without tuple unpacking:

changed = func()
changed |= func2()

@kushalkolar kushalkolar mentioned this pull request Jun 5, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create imgui edge windows without declaring a class auto-create imgui UI using one or more function signatures
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy