Set default text in a text box
Hi all
I have a frame that can be scaled via a text box. When I reload I need the text box to be filled with the saved scale. The frame does correctly scale based on the saved scale on reload however I have not been able to fill the text box with the saved scale value on login. I get no errors and even when I try to hard-set a number in the text box it remains empty. Here is my table of variables; Lua Code:
Lua Code:
Lua Code:
Lua Code:
I have not been able to work out why this is not working correctly, it is probably staring me in the face yet I cannot see where I have stuffed up.:confused: |
In your setup you're not initialising the editbox with any text:
Code:
NewbDevBoxInterfaceFrame.ScaleTextBox:SetText(NewbDevBoxOptionsTable.ButtonFrameScale) I might be missing something... |
One other possibility, if your addon is LOD (eg. a config. addon loaded via a slash command or some other) then it might never see the "PLAYER_LOGIN" event.
|
Hi Fizzlemizz
Sorry for the delayed reply. I once again failed to link my full code. My pastebin links to my lua, toc The table of variables is a global table named in my toc. The playerlogin event fires correctly as I have my setups within the event and they all seem to work correctly. Now typing in the text box has stopped working due to my trying to fix, so I more than likely have broken the text boxes even more. |
I had to change some fontobjects you created to use GameFontNormal so I'm not sure about the actual EditBox size but that's another thing this might hightlight.
In your PLAYER_LOGIN you can use. Code:
NewbDevBoxInterfaceFrame.ScaleTextBox:SetNumber(NewbDevBoxOptionsTable.ButtonFrameScale * 100) |
Hi Fizzlemizz
Cracked it! You provided the answer, I simply took it to the end. Lua Code:
Now it works perfectly, regardless of the font object, as long as the text box is big enough to accommodate the font size. Thanks for your help :D |
All times are GMT -6. The time now is 11:29 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI