Thread: GUI's
View Single Post
10-26-05, 06:47 AM   #63
xmlover
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 25
Originally Posted by Beladona
Code:
myMod = {};
---------------------------------------------
myMod.onLoad = function()
	 this:RegisterEvent("VARIABLES_LOADED");
	 GameTimeFrame:Hide();
end;
myMod.onEvent = function()
	 if (event == "VARIABLES_LOADED") then 
		  -- do whatever here
	 end
	 -- do some more stuff
end;
it's GREAT! a good way to sort the codes sea!

and a few question

1.is that mean I can define function for widget in this way?

for instance. i got a Frame named MyFrame and a button in it call MyButton.
if I want define their OnLoad and OnClick function

can I do it like this?
Code:
MyFrame = {};
MyFrame.OnLoad = function()
               -- codes here
end

MyButton = {};
MyButton.OnClick = function()
              -- codes here
end
but if i wanna refer the MyButton's function like this:
MyFrame.MyButton.OnClick()

how can i do? or is it possible for lua?


2. someone messed their code and i re-make them

at first, i don't know it.through your way, i got it a little and still need your help

Code:
 Oo0o0oOO = {} 
 Oo0o0oOO["QUEST_DETAIL"] = { 
 		OnEvent =
function() Oo0o0oOof() end 
 } 
 Oo0o0oOO["QUEST_PROGRESS"] = { 
 		OnEvent =
function() Oo0o0oOqf() end 
 } 
 Oo0o0oOO["QUEST_COMPLETE"] = { 
 		OnEvent =
function() Oo0o0oOnf() end 
 }
i know that the functions between "Function()" and "end" is what they called

but i was confused by the form....what's the form mean......

i never saw codes like this ......

i know what they try to do is confused me....but i try to catch it and improve my knowledge.
  Reply With Quote