-
Notifications
You must be signed in to change notification settings - Fork 124
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
ImGui::GetClipboardText() not working for win32 #56
Comments
The fix of using a static variable as described at #43 also works for me. |
See issues jvcleave#55 and jvcleave#56
Somehow a comment I thought I had made earlier today is missing: I found that
in ofAppGLFWWindow.cpp is calling itself and crashing when it runs out of stack. |
I've just updated to the current 1.65 master and this issue is still present. The code is
However ofGetWindowPtr()->getClipboardString() returns a local string and the reference to element 0 of that is out of context on return to caller. It can be fixed by recoding as
Rather that making a fork for such a simple fix I've fixed it in my own app by setting io.GetClipboardTextFn equal to my own get clipboard string function as above. |
The above code only works once, on subsequent calls it always returns the same value regardless of new pastes to the clipboard. That's because once the static string has been created and allocated it won’t be reallocated. The solution is to separate the creation from the assignment
|
As Richard said commenting out |
This should be fixed in |
GetClipboardText() returns garbage.
Lines 49 & 50 of EngineGLFW replace the imgui clipboard functions with OF ones
But they don't work. I think it's because they return strings and char * is expected, but I can't quite see it.
These default functions are set up in imgui.cpp:
If I comment out the two lines from EngineGLFW which override them everything then works well for me.
The text was updated successfully, but these errors were encountered: