Open tattataattt2 opened 1 year ago
I got the same issue, but I think I found a workaround. It works if you configure the item after setting it as the primary window :
with dpg.window(tag="Main Window"):
dpg.add_image("texture_tag", tag="image1")
dpg.set_primary_window("Main Window", True)
dpg.configure_item("Main Window", horizontal_scrollbar=True)
I got the same issue, but I think I found a workaround. It works if you configure the item after setting it as the primary window :
with dpg.window(tag="Main Window"): dpg.add_image("texture_tag", tag="image1") dpg.set_primary_window("Main Window", True) dpg.configure_item("Main Window", horizontal_scrollbar=True)
Thanks for your help!!! It works!!!
The root cause is that set_primary_window
overrides window->configData.windowflags
entirely, instead of fixing just those of them that are needed for the primary window. Until this is fixed, @Tetane's workaround is the way to go.
Another side effect of set_primary_window
is that it can modify other windows, in particulary, by marking the window position as dirty. This affects positioning of modal windows:
set_primary_window
is called on another window, the modal window will be displayed in top left corner instead of being centered. This is because it gets dirtyPos=true
during set_primary_window
.
Just copy can paste code below can reproduce the issue.
horizontal_scrollbar=True
buthorizontal_scrollbar
cannot show in screenshot below.Code to reproduce the issue
Screenshot of the issue![Snipaste_2022-12-16_21-48-31](https://user-images.githubusercontent.com/56368459/208112459-640e1203-641b-47df-b486-6497d2212bdb.PNG)
*Horizontal_scrollbar do not show normally![Snipaste_2022-12-16_21-54-37](https://user-images.githubusercontent.com/56368459/208113474-2797c82b-638e-4bf3-b72e-7f323464c34c.PNG)