Thread Tools Display Modes
07-21-21, 08:15 AM   #1
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Scroller not visible until the scroll offset change?

Hello,

I'm designing a scroller for a scroll frame and I have a problem with the scroller itself: it is not shown until I activate the scroll, by click on the arrow-down btn or by mouse-wheel.
The path to my .tga image is valid because the scroller is well visible once it has been "manually activated".

This is my code:
Lua Code:
  1. fSlider.texture = fSlider:CreateTexture("$parentThumbTexture", "BACKGROUND")
  2. fSlider.texture:SetTexture("pathToMyAddon.tga")
  3. fSlider.texture:SetSize(16, 24)
  4. fSlider.texture:SetTexCoord(0.25, 0.75, 0.125, 0.875)
  5. fSlider:SetThumbTexture(fSlider.texture)

It's a lua-converted code from the following XML found on the net:
Code:
<ThumbTexture name="$parentThumbTexture" inherits="UIPanelScrollBarButton" file="Interface\Buttons\UI-ScrollBar-Knob">
	<Size x="16" y="24"/>
	<TexCoords left="0.25" right="0.75" top="0.125" bottom="0.875"/>
</ThumbTexture>
Thank you.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
07-21-21, 10:27 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Lua Code:
  1. fSlider:SetThumbTexture("pathToMyAddon.tga")
  2. local t = fSlider:GetThumbTexture()
  3. t:SetTexCoord(0.25, 0.75, 0.125, 0.875)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
07-22-21, 12:26 AM   #3
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Thanks Fizzlemizz for your code, much better than mine.

However, I still have the same problem and I have to force the slider's thumb to be displayed with:
Lua Code:
  1. slider:SetValue(0)
after the scroll has been updated.
So, it works but I suppose I missed something somewhere (I prefer not to post the entire messy code as it's part of an addon made for testing purpose, trying to understand scroll frame and also trying to make my own scroll design).
__________________
Zax - Addons List, not all maintained.
  Reply With Quote
07-22-21, 11:11 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Presumably you would be doing that as part of initialising the list with it's data.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
07-22-21, 12:12 PM   #5
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Originally Posted by Fizzlemizz View Post
Presumably you would be doing that as part of initialising the list with it's data.
You're right, I should do that only one time on first update.
__________________
Zax - Addons List, not all maintained.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Scroller not visible until the scroll offset change?

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