Thread Tools Display Modes
04/20/15, 09:36 AM   #1
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Help creating text entry box.

Hello,

I am trying to set up an EditBox in my addon that will let me get the typed data as a string for use in various functions.

I have an XML template file which I have set up thusly:

Code:
<Backdrop name="$(parent)SearchBG" inherits="ZO_EditBackdrop" alpha="0.5" >
	<Dimensions x="365" y="25" />
	<Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="BOTTOMLEFT" offsetX="452" offsetY="7" />
</Backdrop>
		
<EditBox name="$(parent)SearchBox" inherits="ZO_DefaultEditForBackdrop" maxInputCharacters="100" editEnabled="true" AnchorFill="SearchBG" >
	<Dimensions x="365" y="25" />
	<Anchor point="TOPLEFT" relativeTo="$(parent)SearchBG" relativePoint="TOPLEFT" offsetX="0" offsetY="0" />
	<OnEnter>
	</OnEnter>
	<OnMouseEnter>
	</OnMouseEnter>
	<OnFocusLost>
	</OnFocusLost>
	<OnTextChanged>
	</OnTextChanged>
</EditBox>
When I attempt to use control:GetText() on the SearchBox control however, I receive the following error:

1459570963798820363:3: function expected instead of nil
stack traceback:
1459570963798820363:3: in function '(main chunk)'
  Reply With Quote
04/20/15, 09:43 AM   #2
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Well, I feel somewhat foolish!

It turns out the problem was that the function I was using to GetText() was defined in a local scope only.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Help creating text entry box.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off