Posted by Philburt on Mon, 18 Jun 2012 11:09:36
My addon (Abigail) is up and running, and many thanks for your help in the past, however I've noticed that the tabs I've added to the auction house frame get wider if I close the auction house and then reopen it again.
My code is:
function abiMakeTheTab(name,tabIndex) -- Create the tab itself. local tab = CreateFrame("Button", "AuctionFrameTab" .. tabIndex, AuctionFrame, "AuctionTabTemplate"); tab:SetID(tabIndex); tab:SetText(name); tab:SetPoint("TOPLEFT", "AuctionFrameTab" .. (tabIndex - 1), "TOPRIGHT", -8, 0); -- Link it into the auction frame. PanelTemplates_DeselectTab(tab); PanelTemplates_SetNumTabs(AuctionFrame, tabIndex); end
and is called using these lines when the AUCTIONHOUSESHOW event fires for the first time:
local abiTabIndex=AuctionFrame.numTabs+1 abiMakeTheTab("Options",abiTabIndex) abiMakeTheTab("Bargains",abiTabIndex+1) abiMakeTheTab("Shopping",abiTabIndex+2) abiMakeTheTab("Selling",abiTabIndex+3)
Everything works ok, and the tabs are displayed and respond to being clicked correctly, its just that if the Auction House is closed, and then reopened (without logging out), my four tabs are wider than they used to be, sometimes pushing the end tab away from the Auction House frame.
I know the tabs are being resized to accommadate the text I'm putting in them, but is there anyway to stop them from doing this, apart from shortening the text that is?
Posted by jnwhiteh on Wed, 20 Jun 2012 11:49:11
I'm not sure if you can set those font strings to truncate, the templates just aren't designed to work that way. You could probably re-actively change their size back to whatever you wanted, but that's a much dirtier solution than just changing the text displayed, in my opinion.
Posted by Philburt on Thu, 21 Jun 2012 12:19:29
I thought that may be the case, but wanted to double check in case I'd missed something.
To get around this, i've shortened the text on each tab, and used a tooltip to display the fuller text when the mouse hovers over it.
Thanks for your help.