WoW:HOWTO: Use Tables Without Generating Extra Garbage: Difference between revisions

m
info.func having the wrong "pseudo code" caused me to have no idea why my dropdown wasn't working for far longer than was necessary....
No edit summary
 
m (info.func having the wrong "pseudo code" caused me to have no idea why my dropdown wasn't working for far longer than was necessary....)
Line 63: Line 63:
   info.text = "Action Button1"
   info.text = "Action Button1"
   info.value = "Value to act on"
   info.value = "Value to act on"
   info.func = DoSomething
   info.func = function() DoSomething() end;
   UIDropDownMenu_AddButton(info);
   UIDropDownMenu_AddButton(info);
    
    
Line 69: Line 69:
   info.text = "Action Button2"
   info.text = "Action Button2"
   info.value = "Another value to act on"
   info.value = "Another value to act on"
   info.func = DoSomethingElse
   info.func = function() DoSomethingElse() end;
   UIDropDownMenu_AddButton(info);
   UIDropDownMenu_AddButton(info);
  end
  end
Line 104: Line 104:
   workingTableForInitMenu.text = "Action Button1"
   workingTableForInitMenu.text = "Action Button1"
   workingTableForInitMenu.value = "Value to act on"
   workingTableForInitMenu.value = "Value to act on"
   workingTableForInitMenu.func = DoSomething
   workingTableForInitMenu.func = function() DoSomething() end;
   UIDropDownMenu_AddButton(workingTableForInitMenu)
   UIDropDownMenu_AddButton(workingTableForInitMenu)
    
    
   workingTableForInitMenu.text = "Action Button2"
   workingTableForInitMenu.text = "Action Button2"
   workingTableForInitMenu.value = "Another value to act on"
   workingTableForInitMenu.value = "Another value to act on"
   workingTableForInitMenu.func = DoSomethingElse
   workingTableForInitMenu.func = function() DoSomethingElse() end;
   UIDropDownMenu_AddButton(workingTableForInitMenu)
   UIDropDownMenu_AddButton(workingTableForInitMenu)
  end
  end
Anonymous user