Thread Tools Display Modes
02-02-09, 03:00 PM   #1
Mahiro
A Murloc Raider
 
Mahiro's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 9
Question FauxScrollFrame problem

hi, i have a problem with the FauxScrollFrames of an addon.
prior to 3.0 everything worked fine but since 3.0 the text in my scrollframes is no longer shown

can someone help me with this problem? i get no error msges or anything and if i print the values to the default frame everything is listed there so i have absolutely no idea why it doesent show in the FauxScrollFrame anymore:/

i created them like explained here: http://www.wowwiki.com/Making_a_scro...lFrameTemplate
  Reply With Quote
02-02-09, 03:33 PM   #2
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Various FauxScrollFrame_ functions were changed in 3.0, so that guide is outdated now. In general, the way to fix it is to pass a reference to the scroll frame as the first parameter in each of those functions. I think one of them already wanted that as the second parameter, but even that one now needs to have it as the first instead.
  Reply With Quote
02-03-09, 04:47 AM   #3
Mahiro
A Murloc Raider
 
Mahiro's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 9
im not sure i fully understand what you mean with first parameter. do i need to set the first value like in this example?

Code:
MyModData = {}

function MyMod_OnLoad()
 MyModData[1] = "first parameter?"
  for i=2,50 do
    MyModData[i] = "Test "..math.random(100)
  end
  MyModScrollBar:Show()
end

function MyModScrollBar_Update()
  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):SetText(MyModData[lineplusoffset]);
      getglobal("MyModEntry"..line):Show();
    else
      getglobal("MyModEntry"..line):Hide();
    end
  end
end
here is what it looks like, you can see the highlight texture in the scrollframe but no text like in the chat output below.

i also searched http://wowcompares.com/3089506 for the FauxScrollFrame but could only find a HybridScrollFrame, is that a new version of the FauxScrollFrame or is it for something else? and in case it has something to do with the FauxScrollFrame, is there some documentation on that?

Last edited by Mahiro : 02-03-09 at 05:00 AM.
  Reply With Quote
02-03-09, 10:36 AM   #4
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
no what i mean is like...
Code:
FauxScrollFrame_GetOffset(MyModScrollBar)
that is correct because MyModScrollBar is getting passed as "self" (not all of those FauxScrollFrame_ functions required that before, now they all do)

also...
getglobal("MyModEntry"..line):Show()
should be
Code:
_G["MyModEntry"..line]:Show()
and similarly for the other instances of getglobal

Last edited by Akryn : 02-03-09 at 10:39 AM.
  Reply With Quote
02-03-09, 11:48 AM   #5
Mahiro
A Murloc Raider
 
Mahiro's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 9
thx for that info but it doesnt fix the problem.
i decided to write my own scrolldown which should be much simpler to set up
heres a preview on what i got so far
  Reply With Quote
02-03-09, 03:46 PM   #6
twobits
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 38
Did you post all of your code or do you have some of it in xml?

If you have the code in xml I think you do you want to see http://www.wowinterface.com/forums/s...84&postcount=6 most likely.

Last edited by twobits : 02-03-09 at 03:50 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » FauxScrollFrame problem


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