Skip to content

@Figure.add_gui and append_gui decorators #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 10 commits into
base: main
Choose a base branch
from
Open

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Jun 1, 2025

closes #848

@kushalkolar kushalkolar requested a review from clewis7 as a code owner June 1, 2025 00:20
@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
@kushalkolar kushalkolar changed the title more imgui stuff! @Figure.add_gui and append_gui decorators Jun 29, 2025
@kushalkolar
Copy link
Member Author

Failures are due to an imgui update

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
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