godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 93 forks source link

Expose Tree's internal ScrollBar node #6893

Open CsloudX opened 1 year ago

CsloudX commented 1 year ago

Describe the project you are working on

A GUI App

Describe the problem or limitation you are having in your project

I want listen if the Tree was scrolled but I'm not found any signals or ScrollBar memeber.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Exposed the ScrollBar member. Or implement some signal like h_scrollbar_scrolled and api like set_h_scrollbar_value(value:float)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

/

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, I can't

Is there a reason why this should be core and not an add-on in the asset library?

It's core.

heppocogne commented 1 year ago

I think get_v_scroll() and get_h_scroll() should be added to get scroll bar nodes.

AThousandShips commented 1 year ago

There's a workaround, it's possible to extract the child node that is a HScrollBar, this is a workaround that works, though inconvenient, and unreliable as it's not exposed: tree.find_children("", "HScrollBar", false, false) or just iterate over the children (including internal)