View Single Post
11-12-10, 07:40 PM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Pass a reference to the object with DropDownMenuItem_OnClick. Example:
Code:
f = CreateFrame("MyNewFrame")
DropDownMenuItem_OnClick(f)
Then add a parmeter to the function and use it within the function:
Code:
function DropDownMenuItem_OnClick(self)
    UIDropDownMenu_SetSelectedValue(self.owner, self.value);
	PlaySound("igMainMenuOptionCheckBoxOn");
  if (self.value == 0) then
    --We clicked the first menu item. Enter code here to affect the rest of your mod.
  elseif (this.value == 1) then
    --We clicked the second menu item. Enter code here to affect the rest of your mod.
  end
end
[Edit]
LUA isn't OOP.
  Reply With Quote