Thread Tools Display Modes
10-05-06, 11:19 PM   #1
neostorm
A Murloc Raider
Join Date: Aug 2006
Posts: 6
Scroll Frame Help

Anyone know a good way to have a scroll frame i've been stuck at this hurdle in my project for some time now. With this limit in the Designer i've considered having a file i edit manually and never open in the editor again after it's set up.

My last attemped involved useing a .lua and creating a .xml file Not a Form. The issues i'm having now is being able to call functions from outside of the .script file.

EX:

Code:
MyModData = {};

function MyMod_OnLoad()
  for i=1,50 do
    MyModData[i] = "Test "..math.random(100)
  end
    --Esc Close Option
    tinsert(UISpecialFrames,this:GetName());

    MyModScrollBar:Show();
end

function MyModScrollBar_Update()
    DEFAULT_CHAT_FRAME:AddMessage("UpdateCalled");
  local line; -- 1 through 5 of our window to scroll
  local lineplusoffset; -- an index into our data calculated from the scroll offset
  FauxScrollFrame_Update(MyModScrollBar,50,5,16);
  for line=1,5 do
    lineplusoffset = line + FauxScrollFrame_GetOffset(MyModScrollBar);
    if lineplusoffset < 50 then
      getglobal("MyModEntry"..line.."_Text"):SetText(MyModData[lineplusoffset]);
      getglobal("MyModEntry"..line):Show();
    else
      getglobal("MyModEntry"..line):Hide();
    end
  end
end
Code:
        <Scripts>
          <OnVerticalScroll>
            FauxScrollFrame_OnVerticalScroll(16, MyModScrollBar_Update);
          </OnVerticalScroll>
          <OnShow>
            MyModScrollBar_Update()
          </OnShow>
        </Scripts>
The OnShow works but for some reason the update doesn't work.
And i'm unable to call MyModScrollBar:Show();
from outside of the MyModScrollBar.lua

Any help or tips how i might be able to call these functions correctly?

Code came from http://www.wowwiki.com/

My Mod: Raid Leader Plus
http://www.mtsu.edu/~jea2g/RLP.zip

Last edited by neostorm : 10-05-06 at 11:47 PM.
  Reply With Quote
10-06-06, 04:31 AM   #2
Nulkris
A Cobalt Mageweaver
 
Nulkris's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 214
The first thing I would check is the load order. The files are loaded in the order that they appear in the toc file (which is the same as the Project View of the Project Explorer). So in this case I would put the lua file there before the xml file, so that all your code is preloaded before any calls from within the xml file are done.
__________________
Nulkris - A80 Rogue - Proudmoore
(Also Drukris, Hamkris on Proudmoore; Hulkris on Jubei'Thos & Khaz Modan)
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Scroll Frame Help

Thread Tools
Display Modes

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