WoW:HOWTO: Scroll EditBoxes to the left programatically: Difference between revisions

no edit summary
No edit summary
 
No edit summary
Line 8: Line 8:


== Solution ==
== Solution ==
The easiest way is to do the following when the EditBox (or its parent) is loaded:
EditBox:SetCursorPosition(0);
EditBox:ClearFocus();
This will (imperceptibly) set the cursor at the leftmost point of the editbox, forcing it to scroll, and then clear focus, leaving the EditBox scrolled.
== A Messier Solution ==


The EditBox:Insert() function scrolls the editbox to show the place where the insert took place. But ONLY after an OnUpdate event has occured following the latest :SetText() call.
The EditBox:Insert() function scrolls the editbox to show the place where the insert took place. But ONLY after an OnUpdate event has occured following the latest :SetText() call.
Anonymous user