10000 When will the docking branch be released / Can i still use it / What is it missing · Issue #348 · pyimgui/pyimgui · GitHub
[go: up one dir, main page]

Skip to content
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

When will the docking branch be released / Can i still use it / What is it missing #348

Open
damusss opened this issue Sep 17, 2023 · 6 comments

Comments

@damusss
Copy link
damusss commented Sep 17, 2023

I never commented on github or opened issues or pull requests so the location of this question might be inappropriate, I'm sorry in advance.
I saw there is this docking branch which is separated from 2.0.0 which I have installed. I am making a very very simple "game (engine?)" and I made the properties panel. In all true "game engines" the tab windows are "stuck" there and you can only rearrange them, and I know this is possible with docking, but I noticed it's not currently available in the pyimgui version I have installed and here on github it says I should not use it so I have a few questions:

  • When will the docking branch be completed (rough estimate)?
  • Is it really that unsafe to use it? I need very simple functionality of fixing the windows to a dock
  • What features are missing?
  • and since I usually only install packages with PIP, if I were to install the docking branch, after I download the code what would the "terminal command" to install it be? (probably related to setup.py I think)

Thanks.

@KinoxKlark
Copy link
Member

Thanks for reaching out, you are in the right place, do not worry ;)

Yes, you are right, the "stuck" functionality you are describing (as I understand it) corresponds to the docking feature which is only part of the docking branch. It has not been integrated into the main branch since the very same feature from original c++ library is also separated in a docking branch. I may consider adding it to our main branch in the future since it is an often requested feature.

In this branch, you may refer to example doc/examples/integrations_glfw3_docking.py for the usage of this docking functionality.

When will the docking branch be completed (rough estimate)?

I can't say, these days I do not have a lot of free time to work on pyimgui and I must rely on the rare contributions of community. The docking branch in particular is the fruit of hard work from some community members and I myself didn't touch it at all. It is not planned to move forward for now, but it seems that it may be enough for your needs.

Is it really that unsafe to use it? I need very simple functionality of fixing the windows to a dock

No, I don't think that it is as "unsafe" to use as I have written in readme. The truth is that I didn't spend the necessary time to ensure every functionality has been properly mapped and to list all remaining features to implement. If this moves forward some days, it may change a bit and you may have to refactor some of your code if you use it (or ensure that you keep the same version for your project). I don't think that it is dangerous to use as mapping functionalities is pretty simple, it is just about implementing python functions that calls c++ functions. All the hard work has already been leveraged by DearImGui community. The minimal functionalities of the docking branch are mapped and they were working fine the last time I tested them.

What features are missing?

I don't know, I would have to go through it which I have not been able to do yet. But, as far as I know, you should have everything you need for the "very simple functionality of fixing the windows to a dock" part.

and since I usually only install packages with PIP, if I were to install the docking branch, after I download the code what would the "terminal command" to install it be? (probably related to setup.py I think)

You would have to clone the repository and checkout the docking branch.

git clone git@github.com:pyimgui/pyimgui.git pyimgui
cd pyimgui
git checkout docking

For building the lib, you should find everything you need in the https://github.com/pyimgui/pyimgui/blob/docking/HACKING.md file.

Don't hesitate to ask if you encounter any difficulty.

@damusss
Copy link
Author
damusss commented Sep 18, 2023

Thank you so much for the reply, I'll try what you suggested :)

@damusss
Copy link
Author
damusss commented Sep 18, 2023

So, I already had problems, RIP
first, my git commands have permission issues.
"""
git clone git@github.com:pyimgui/pyimgui.git pyimgui
Cloning into 'pyimgui'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
"""
Tried downloading the docking branch zip, of course I could not checkout, tried running the make command anyways and.. it's not a command on my windows system. How do I install it? I can maybe search this online but without the git command working it would probably be useless.
Thanks for your time

@learn-more
Copy link
Collaborator

So, I already had problems, RIP first, my git commands have permission issues. """ git clone git@github.com:pyimgui/pyimgui.git pyimgui Cloning into 'pyimgui'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. """ Tried downloading the docking branch z B06A ip, of course I could not checkout, tried running the make command anyways and.. it's not a command on my windows system. How do I install it? I can maybe search this online but without the git command working it would probably be useless. Thanks for your time

Try cloning over https instead of over git.

As for 'fixing' a window to one place, you can simulate that behavior by setting hardcoded size and location (set_next_window_position and set_next_window_size, or setting an initial position and adding the window flags imgui.WINDOW_NO_RESIZE and imgui.WINDOW_NO_MOVE from imgui.WINDOW_NO_RESIZE).

@damusss
Copy link
Author
damusss commented Sep 19, 2023

Thanks. I'll try both methods

@damusss
Copy link
Author
damusss commented Sep 19, 2023

Everything went fine. this error is not related to the installation

Traceback (most recent call last):
  File "b:\Py\Apps\GatorEngine\main.py", line 13, in <module>
    main()
  File "b:\Py\Apps\GatorEngine\main.py", line 9, in main
    editor.run()
  File "B:\Py\Apps\GatorEngine\geditor\src\geditor\editor.py", line 273, in run
    self.imguiLayer.frameEnd()
  File "B:\Py\Apps\GatorEngine\geditor\src\geditor\imguilayer.py", line 64, in frameEnd
    imgui.render()
  File ".\imgui/imgui.base.pyx", line 1671, in imgui.core.render
imgui.core.ImGuiError: ImGui assertion error ((key_mod_flags == 0 || g.IO.KeyMods == key_mod_flags) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods") at imgui-cpp/imgui.cpp:7798

i THINK i set up docking correctly. Here is what i have done, taken from a java tutorial:

def docking(self):
        windowFlags = imgui.WINDOW_MENU_BAR | imgui.WINDOW_NO_DOCKING

        imgui.set_next_window_position(0, 0)
        imgui.set_next_window_size(Singletons.app.window._width, Singletons.app.window._height)
        imgui.push_style_var(imgui.STYLE_WINDOW_ROUNDING, 0)
        imgui.push_style_var(imgui.STYLE_WINDOW_BORDERSIZE, 0)
        windowFlags = windowFlags | imgui.WINDOW_NO_TITLE_BAR | imgui.WINDOW_NO_COLLAPSE | \
                imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE | \
                imgui.WINDOW_NO_BRING_TO_FRONT_ON_FOCUS | imgui.WINDOW_NO_NAV_FOCUS

        imgui.begin("Gator Editor Dockspace", True, windowFlags)
        imgui.pop_style_var(2)

        imgui.dockspace(imgui.get_id("GatorEditorDockspace"))

i call end in another function, but it's the same if i call it immediately.

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

No branches or pull requests

3 participants
0