Author Topic: Issue w/ ScrollToBottom();  (Read 648 times)

I have a ScrollGuiControl set to scrolltobottom(); every time it updates.

i.e.
function test(%a){
  testText.setValue(%1);
  testScroll.ScrollToBottom();
}

It does this, however, as soon as it scrolls to the bottom, it scrolls back up to the top? Not sure what to do?

Could be wrong but:

function test(%a){
  testText.setValue(%1);
  testScroll.ScrollToBottom(1);
}

simply use .resize() to position the object inside the scroll control to exactly where you want it

Is the parameter to testText.setValue a filler? If not, you may have meant %a. %1 is a syntax error.

Try calling testText.forceReflow(); before scrolling to the bottom.

Edit: Also, is testText a GuiMlTextCtrl? If so you should be using testText.setText("text"); instead of .setValue.
« Last Edit: August 24, 2012, 02:25:45 AM by Greek2me »

simply use .resize() to position the object inside the scroll control to exactly where you want it
How?

so say you have a scroll control that is 10x10 with a swatch inside that is also 10x10
you add a new line to whatever is on the swatch, so it needs to be 4 pixels larger and scroll to the bottom.  Make it 4 pixels taller and then make it 4 pixels higher

%swatch.resize(0, -4, 10, 14);

(assuming you have some magical custom scroll control with no border)

should do the trick.

or if you want something that will always work when you extend the swatch by %a pixels

%swatch.resize(getword(%swatch.getposition(), 0), getword(%swatch.getposition(), 1)-%a, getword(%swatch.getextent(), 0), getword(%swatch.getextent(), 1)+%a);