WoW:API Frame CreateFontString and WoW:API SetCurrentGuildBankTab: Difference between pages

From AddOn Studio
(Difference between pages)
Jump to navigation Jump to search
(Created page with "  {{widgetmethod}} fontstring = Frame:CreateFontString(["name" [, "layer" [, "inherits"]]]) ---- ;''Arguments'' : name - Global name for the new font string (string) : ...")
 
(Created page with "This API appears to be broken in the current patch as of 11/1/2011 It DOES NOT really change the current guild bank tab! However, if you call GetCurrentGuildBankTab(), it will ...")
 
Line 1: Line 1:
 
This API appears to be broken in the current patch as of 11/1/2011
{{widgetmethod}}


fontstring = Frame:CreateFontString(["name" [, "layer" [, "inherits"]]])
It DOES NOT really change the current guild bank tab! However, if you call GetCurrentGuildBankTab(), it will return the last digit given to this function.


----
;''Arguments''


:   name - Global name for the new font string (string)
perhaps a better approach would be to click the tabs directly:
:   layer - Graphic layer on which to create the font string; defaults to ARTWORK if not specified (string, layer)
local SetCurrentGuildBankTab
:   inherits - Name of a template from which the new front string should inherit (string)
do
 
local clickFunctions = {
----
function() GuildBankTab1Button:Click() end,
;''Returns''
function() GuildBankTab2Button:Click() end,
 
function() GuildBankTab3Button:Click() end,
:fontstring - Reference to the new FontString object (fontstring)
function() GuildBankTab4Button:Click() end,
 
function() GuildBankTab5Button:Click() end,
----
function() GuildBankTab6Button:Click() end
;''Example''
}
 
SetCurrentGuildBankTab = function(tab)
 
local func = clickFunctions[tab]
;''Result''
if func then
 
return func()
 
else
----
return error(string.format("Tab %s cannot be clicked!", tab))
;''Notes''
end
end
end

Revision as of 15:04, 1 November 2011

This API appears to be broken in the current patch as of 11/1/2011

It DOES NOT really change the current guild bank tab! However, if you call GetCurrentGuildBankTab(), it will return the last digit given to this function.


perhaps a better approach would be to click the tabs directly:

local SetCurrentGuildBankTab
do
local clickFunctions = {
	function() GuildBankTab1Button:Click() end,
	function() GuildBankTab2Button:Click() end,
	function() GuildBankTab3Button:Click() end,
	function() GuildBankTab4Button:Click() end,
	function() GuildBankTab5Button:Click() end,
	function() GuildBankTab6Button:Click() end
}
SetCurrentGuildBankTab = function(tab)
	local func = clickFunctions[tab]
	if func then
		return func()
	else
		return error(string.format("Tab %s cannot be clicked!", tab))
	end
end
end