Closed oxysoft closed 1 month ago
Even button appears to be missing a default value for size, so all buttons are flagged with errors in my IDE
def button(label, size, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
"""
button(label: str, size: imgui_bundle._imgui_bundle.imgui.ImVec2 = <imgui_bundle._imgui_bundle.imgui.ImVec2 object at 0x7fe9872b76b0>) -> bool
button
"""
pass
Hello,
What you are pointing here are likely definitions inferred from you IDE, probably by a tool such as stubgen
The text "NOTE: unreliably restored from doc") is an indication of it.
ImGui Bundle comes with fully typed and documented stubs: look at this for example
You should look inside your IDE on how to tell it not to use auto-generated stubs but rather the official ones.
Hmmm I followed the instructions provided by JetBrains and it's still generating its own stubs no matter what I do.
Alright so this is some python bullshit. After doing what I showed in the image above, you also have to correct the imports, and pycharm will still never propose the correct import so from now on we have to add the imports manually rather than using the keyboard shortcut.
from imgui_bundle import imgui
But that still wasn't enough, something was utterly broken with my venv and it still wouldn't locate this import. After recreating the venv from scratch and starting with this package, it now works.
OK this issue arose again after some other venv management shanenigans and I found out that the issue is most likely that the venv absolutely has to be called .venv
or it can lead to issues with PyCharm. venv
or anything else could ruin your day. Just noting down in case somebody else ever stumbles upon this.
See for example these bindings from the main
imgui
API:In this case, it seems like
callback
should have a default argument such asNone