WoW:HOWTO: Scroll EditBoxes to the left programatically (source)
Revision as of 02:49, 8 April 2008
, 8 April 2008no 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. | ||