• 0

    posted a message on Adding several EditBoxes to a window
    Quote from Seerah
    Did you actually use the library's API to *do* anything?


    Yes, I added the test they use to create a table to my On_Load function
    Posted in: Need Help?
  • 0

    posted a message on Adding several EditBoxes to a window
    Quote from Dridzt

    Finally you might want to use a library to dispense with coding some UI parts and only focus on your functionality.

    For example: LibSpreadsheet or lib-ScrollingTable (the latter is read-only I think)


    I've been trying to use the first one but:

    - It looks like on 2010 they stopped maintaining the code. Do you think is probable that some problems may arise later due to API updates?
    - To use this library, I created an embeds.xml file containing this code:
    <Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
      <Script file="Libs\LibStub\LibStub.lua"/>
      <Include file="Libs\LibSpreadsheet-1.0\LibSpreadsheet-1.0.lua"/>
    </Ui>

    And then added it to the .toc. In my Lua file I import it with
    "local lss = LibStub("LibSpreadsheet-1.0", true); "
    I don't get any errors but nothing happens either. Did I missed any step needed for importing a library?

    Even more important for me now, what do you recommend for debugging? I'm checking FrameXML.log for errors and running the addon in the game but this is of course a slow method.

    I'll change my code to more Lua, less XML. Thank you for all the advice and help!! :)
    Posted in: Need Help?
  • 0

    posted a message on Adding several EditBoxes to a window
    Quote from Dridzt

    You can use [code][/code] tags around your .xml and .lua snippets so the forum retains formatting and uses a scrollframe for larger snippets.

    Templates need to use the virtual='true' keyword.


    Thank you, edited :)

    Quote from Dridzt

    You could also use a frame factory function and get rid of xml entirely, create your frames in .lua using Frame API.

    I've read you should try to use XML for structure and Lua for functionality but I guess this is a style-based choice?

    Quote from Dridzt

    Finally you might want to use a library to dispense with coding some UI parts and only focus on your functionality.

    For example: LibSpreadsheet or lib-ScrollingTable (the latter is read-only I think)


    This looks very interesting, thank you!!
    Posted in: Need Help?
  • 0

    posted a message on Adding several EditBoxes to a window
    I want to create a main window which contains several editboxes in a row. The goal is to have a kind of table and its fields would be editable text fields.

    I am trying to create a template in XML for an editbox and then use a loop in Lua to add 10 editboxes to the main window. But when I run the addon I can only see the main window.

    I believe I have not understood some concepts. For instance, I thought On_Update was not run before executing the slash command for my addon but apparently it does. For my current problem, it might be that I don't understand well how layers work?

    This is the code for the XML template:
       <EditBox name="ColWEditBoxTemplate" parentKey="input" autoFocus="false">
            <Size>
            	<AbsDimension x="400" y="20"/>
            </Size>
            <Anchors>
              <Anchor point="CENTER">
                <Offset x="32" y="100"/>
              </Anchor>
            </Anchors>
            <Scripts>
              <OnEscapePressed>
                self:ClearFocus()
              </OnEscapePressed>
              <OnTextChanged>
                ColW_Update()
              </OnTextChanged>
            </Scripts>
            <FontString inherits="GameFontHighlight"/>
          </EditBox>
    


    And this is the code for the loop:
     	-- Create text boxes
      	self.texboxes = {}
      	for idx=1, 10 do 
      		local textbox = CreateFrame("EditBox", "ColW_EditBox" .. idx, self, "ColWEditBoxTemplate")
      		self.texboxes[idx] = textbox
      		if idx == 1 then
      			textbox:setPoint("TOPLEFT", 40, -73)
      		else
      			textbox:setPoint("TOPLEFT", self.texboxes[idx-1],"TOPRIGHT", 12, 0)
      		end
      	end
    
    Posted in: Need Help?
  • 0

    posted a message on Understanding FrameXML.log
    Quote from Farmbuyer
    Check the line endings, particularly on the last line of the file. If you've managed to embed some non-printing weirdness, then it won't show up on the screen when you edit it, but it will still be "there" as part of the filename.


    That was it! It works now, thank you so much :D
    Posted in: Need Help?
  • 0

    posted a message on Understanding FrameXML.log
    Quote from Dridzt
    I don't see anything in your .toc that would justify that error.

    It appears as you have a file reference that points to Interface\AddOns\CastY\

    I bolded the problematic part.


    I'm afraid that was a copy-paste typo. I tried again, it looks I wasn't getting the whole error. Now I can see:
    4/17 20:25:51.073 Couldn't open Interface\AddOns\CastW\CastW.xml??

    But the .xml file is in that directory, it was working before and according to XMLNanny is well-formed.
    Posted in: Need Help?
  • 0

    posted a message on Understanding FrameXML.log
    I am following a tutorial to develop my first addon and now it is not being loaded. I opened FrameXML.log and this is what I got:

    4/17 20:08:15.802 Loading add-on CastW
    4/17 20:08:15.802 ** Loading table of contents Interface\AddOns\CastW\CastW.toc
    4/17 20:08:15.802 Couldn't open Interface\AddOns\CastY\??

    I have googled this error but can't find a solution. Could anyone give me a hint? Thanks! :)

    If it helps, this is the content of CastW.toc:
    ## Interface: 50200
    ## Title: CastW
    ## Title-esES: CastW en Espanol
    ## Author: Noob1320
    ## Notes: My first addon
    ## X-Category: Chat/Communication
    Localization.enUS.lua
    Localization.esES.lua
    CastW.lua
    CastW.xml
    Posted in: Need Help?
  • To post a comment, please or register a new account.