Closed gskluzacek closed 2 years ago
The OpenGL thing is a known error with some Macs (not sure if this is an M1 thing or a laptop thing or a GPU thing), which I've heard requires a workaround like what you found, so it's not just you. The crash in the menu bar example is exactly what my PR is supposed to fix. Even though the exception is caught, the imgui stack is corrupted and the program will crash anyway. To fix this you would have to use my PR (not yet accepted) and the with statement shown in demo-newstyle.py. The rest of the issues stem from the fact that when you pip install
you get the latest published version, not the dev version. As such the things in the delta from the current release to the dev branch will crash. To try the dev branch or my PR you would have to git clone and checkout your desired commit, then pip install -e . -v
(or replace .
with the location where you cloned).
Thanks for the quick followup and the reassurance that it not just me with regards to the errors from the demo.py script.
For some reason, I was under the assumption that the demo.py
script only contained code that was from BEFORE your pull request and that the demo-newstyle.py
script was the code AFTER your pull request.
Though its not your problem, any idea why happens when I try to run the Basic GUI drawing loop code given on the pyimgui read the docs site ?
Yes that is correct, demo.py contains code that was from before my PR, and demo-newstyle.py contains code after the PR. But remember here that the before is still on the dev branch, which is not what you get when you pip install.
latest release (what you get when you pip install)
/
--------------------master
\----------------------------------dev
\-my PR
As for why the Basic GUI drawing loop code doesn't work it is because the documentation is just not clear about what that snippet is supposed to do (docs can always be improved! submit your own PR!). It does not actually draw the window and it doesn't even contain a loop. They attempt to explain this:
Of course this is not enough to create fully working GUI application with pyimgui. The bare imgui.core module is not able to render anything on its own. The imgui.render() function just passes abstract ImGui drawing commands to your rendering backend. In order to make it work you will first have to initialize the rendering backend of your choice.
Actual minimal examples are much closer to what is found in my demo.py and the official examples can be found here: https://github.com/pyimgui/pyimgui/tree/master/doc/examples The integrations_glfw3 would be the most similar to what I was doing, but if OpenGL is not well-supported on your Mac, you may want to try a different backend such as sdl2.
Thanks for the clarification....
Ya, I read that in the documentation as well.. but saw the "allegedly" displayed window as an image in the docs right below the sample code. So I was confused, to say the least, but thought: now why would the show a screenshot if the example code didn't produce anything!! LOL
Thanks for your help.
Hi James,
pip install imgui[full]
After activating my virtualenv and runnIng
demo.py
(which I downloaded from your git hub repo), I got the following error:ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)
Which I was able to fix by following the directions here basically, by modifying
ctypesloader.py
file in my virtualenv'slib/python3.6/site-packages/OpenGl/platform
directoryand changing this:
fullName = util.find_library( name )
to this:
fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL'
Then at least I was able to get
demo.py
to launch and the main window came up.Though I did notice that the first window Hello, Imgui! opened right on top of the Active Examples window, and slightly too small... all the other windows also open right on top of the other windows that were already displayed. Not sure if that's an issue but, from the video it didn't look
demo.py
behaved that way when you ran it. Though I did notice that aimgue.ini
file did appear that seems to manage the window sizes and locations...That minor issue aside, when I try the menu bar example window, it shows fine, but when I click the close menu item on that window's file menu, the program crashes & I get the following error.
The one other issue I'm seeing is that when I try to open the last four example windows: tab bar, list box, popup context void and table, the program crashes with errors similar to the following:
The attribute name mentioned in the error messages and the line number specified varies. For example: for the list box example, the attribute named in the error is
begin_list_box
and the line number is197
instead of189
as shown above.Additionally, the simple Basic GUI drawing loop code given on the pyimgui read the docs site does not bring up the window as shown there. The program just runs and exists without any thing being displayed and no error messages.
I'm rather suspect at this point, since the original error that occurred with openGL.
Do you think its my installation, OS, ??? Do you have any suggestions that you think I should try?
Here is the code from the pyimgui read the docs site:
Here's a screen shot of the example windows that I am able to open
By the way, I really love the content that you put out on your Youtube channel. I think what you contribute to the community is just fantastic. Keep up the good work.
Regards, Greg Skluzacek