← 返回首页
`@Figure.add_gui` and `append_gui` decorators by kushalkolar · Pull Request #849 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

@Figure.add_gui and append_gui decorators#849

Open
kushalkolar wants to merge 10 commits into
mainfrom
imgui-decs
Open

@Figure.add_gui and append_gui decorators#849
kushalkolar wants to merge 10 commits into
mainfrom
imgui-decs

Conversation

kushalkolar commented Jun 1, 2025
edited
Loading

Copy link
Copy Markdown
Member

closes #848

kushalkolar requested a review from clewis7 as a code owner June 1, 2025 00:20
Comment thread examples/guis/imgui_decorator.py Outdated Show resolved Hide resolved

clewis7 commented Jun 2, 2025

Copy link
Copy Markdown
Member

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

clewis7 commented Jun 2, 2025

Copy link
Copy Markdown
Member

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 commented Jun 2, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

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 mentioned this pull request Jun 5, 2025
14 tasks
kushalkolar changed the title more imgui stuff! @Figure.add_gui and append_gui decorators Jun 29, 2025

Copy link
Copy Markdown
Member Author

Failures are due to an imgui update

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.