-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
Tables and collapsible elements overlap in horizontal groups #2440
Comments
@nickpas Did you find a workaround? In my case it seems to be fine when setting a width for the group or table. However, the same happens for collapsing_header and tree_node where you can't set a width... |
This is due to a bug in Dear ImGui, which means there's no easy fix on the DPG side. See ocornut/imgui#6421. |
Add the following to your tables so that they don't adjust to the container size (i.e. group size, which in turn gets extended by the other table): policy=dpg.mvTable_SizingFixedFit, no_host_extendX=True Unfortunately this does not solve the problem of incorrect content clipping. As a workaround, you can place your tables into cells of another table, with the outer table providing scrollbars instead of relying on the window scrolling. with dpg.table(header_row=False, policy=dpg.mvTable_SizingFixedFit, scrollX=True):
dpg.add_table_column()
dpg.add_table_column()
with dpg.table_row():
with dpg.group():
dpg.add_text("table 1")
with dpg.table(header_row=False, policy=dpg.mvTable_SizingFixedFit, no_host_extendX=True):
for i in range(5):
dpg.add_table_column()
for i in range(300):
with dpg.table_row():
for j in range(5):
dpg.add_text(f"T1 Row{i} Column{j}")
dpg.add_text("under table 1")
with dpg.group():
dpg.add_text("table 2")
with dpg.table(header_row=False, policy=dpg.mvTable_SizingFixedFit, no_host_extendX=True):
for i in range(5):
dpg.add_table_column()
for i in range(310):
with dpg.table_row():
for j in range(5):
dpg.add_text(f"T2 Row{i} Column{j}")
dpg.add_text("under table 2") |
Interesting.... thank you for the clever workaround! I will try it over the next few days. |
Discussed in #2294
Originally posted by nickpas February 23, 2024
Hi all,
I tried to make a screen layout showing multiple tables next to each other (with scroll bars in case the window can not fit everything). To arrange them, I used groups (with horizontal=True).
The result seems however to act rather strange. Mainly horizontal scrolling seems to be broken: all table content outside the original view doesn't render. I made a small example with the elements I used in my real program (see below). If you resize till you get a horizontal scroll bar and then scroll, you should see the effect (I run on MacOS).
The text below the table (in the same group), also seems to influence the behaviour. (If you remove it, the scrolling & rendering acts differently.)
For some reason, the tables also partially render on top of each other.
From the documentation (and many searches) I could not determine if it is allowed to put tables in groups or not. Can anyone clarify if what I try should work or not?
The text was updated successfully, but these errors were encountered: