Programmatically change GUI size in mujoco_viewer / mujoco_viewer_passive
The feature, motivation and pitch
The GUI that opens up when launching the viewer is set at about 960 x 540 (approx). I can manually resize it once it opens up. But this is getting tedious as I have to keep doing it every single time.
Is it possible to set this up programmatically?
In the past, I could do with something like this: window = glfw.create_window(800, 600, "Demo", None, None), but it does not look like glfw's handle is exposed in the viewer.py which makes it impossible to use the functions, set_window_size and get_window_size.
Alternatives
- resizing the window manually (works but tedious)
- Tried adding glfw.create_window in viewer.py (does not work)
Additional context
No response
Good suggestion. Do you want to try doing doing this yourself and sending a PR?
Thanks for your response, Yuval. Hmmm. I don't know how to do this. Can you give me some directions so I can try? I am not clear how to expose glfw handle or object. There isn't any handle/object for glfw in viewer.py. Which file do I start looking into?
steps:
- build from source
- find out where the hard-coding occurs
- expose what you want to expose.
the place to look is not in the py file but in simulate.cc
+1 on this feature. I'm opening multiple windows. Its hard to co-ordinate them without this feature