DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Multi-Viewport Solutions

Open Umbrella167 opened this issue 1 year ago • 4 comments

Is there a multi-viewport feature in Dear PyGui? I'm currently facing the issue of having too many child windows, and I hope the child windows can have independent viewports. Or in which direction should I look to solve this problem?

Umbrella167 avatar Nov 16 '24 06:11 Umbrella167

Unfortunately DPG only supports a single viewport. Deep inside, it stores the viewport in a global variable, so there can be only one viewport per process.

You can use multiple processes (not threads) to open multiple viewports. Take a look at the multiprocessing module, not sure how much it helps though.

v-ein avatar Nov 16 '24 08:11 v-ein

Is there a multi-viewport feature in Dear PyGui? I'm currently facing the issue of having too many child windows, and I hope the child windows can have independent viewports. Or in which direction should I look to solve this problem?

Hello. How did you solve this problem? Can I have the code, please

lavrentijav avatar Aug 01 '25 08:08 lavrentijav

Is there a multi-viewport feature in Dear PyGui? I'm currently facing the issue of having too many child windows, and I hope the child windows can have independent viewports. Or in which direction should I look to solve this problem?Dear PyGui 有多视口功能吗?我目前遇到子窗口太多的问题,希望子窗口能有独立的视口。或者我应该从哪个方向解决这个问题?

Hello. How did you solve this problem? Can I have the code, please你好。你是怎么解决这个问题的?可以给我代码吗?

Dear PyGui currently doesn't support multi-viewport features natively. The workaround would be to implement it using multiple processes, but this requires writing a lot of code for inter-viewport communication and management, which can be quite cumbersome. If having multiple independent viewports is a strict requirement for your project, I would suggest considering other GUI libraries that have built-in support for this feature. Libraries like PyQt or Tkinter offer better support for multiple windows/viewports out of the box.

Umbrella167 avatar Aug 01 '25 17:08 Umbrella167

Is there a multi-viewport feature in Dear PyGui? I'm currently facing the issue of having too many child windows, and I hope the child windows can have independent viewports. Or in which direction should I look to solve this problem?Dear PyGui 有多视口功能吗?我目前遇到子窗口太多的问题,希望子窗口能有独立的视口。或者我应该从哪个方向解决这个问题?

Hello. How did you solve this problem? Can I have the code, please你好。你是怎么解决这个问题的?可以给我代码吗?

Dear PyGui currently doesn't support multi-viewport features natively. The workaround would be to implement it using multiple processes, but this requires writing a lot of code for inter-viewport communication and management, which can be quite cumbersome. If having multiple independent viewports is a strict requirement for your project, I would suggest considering other GUI libraries that have built-in support for this feature. Libraries like PyQt or Tkinter offer better support for multiple windows/viewports out of the box.

Thanks. I've already found a solution for myself. I'm using multiprocessing + queue. The code hasn't become much longer

lavrentijav avatar Aug 01 '25 19:08 lavrentijav