Jump to content
Nick Seafort

Reset textbox scrollbar to top?

Recommended Posts

Hi everyone, this has been an ongoing issue that I've not had any joy in resolving.

 

I've built a GUI for an aspect of our modpack, and it's all working rather well. There is a large textbox (contained within a controlgroup class with an attached vertical scrollbar class) that displays information relevant to a selection, and when this selection is changed the text gets updated and the textbox gets resized for the new text - note that the frame remains the same size, but resizing the textbox means that the scrollbar at the side has the correct range to scroll through rather than either blank space at the bottom of the text or it being cut off.

 

The problem is that the relative position of the scrollbar remains the same after I resize the textbox regardless of what I do. So if I had scrolled a third of the way down the text before changing it, the scrollbar (and text position) would be a third of the way down the new text. This isn't a dealbreaker, but it's certainly not tidy!

 

The only related function I can see is sliderSetPosition, which as the scrollbar/slider page claims scrollbars and sliders are synonymous should work... but it doesn't make any difference and nor does sliderPosition return any value other than 0. I've had a look around but I can't seem to find anywhere in vanilla Arma where something like this is done rather than just having the element being destroyed and recreated - something I'd prefer to avoid!

 

Is sliderSetPosition really the right command and I've done something wrong, is there an alternate command I've missed, or is this not possible without destroy/recreate?

 

Thanks!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×