m
.func was formatted wrongly, which lead to a long time where I was having a problem, but couldn't figure out why, since most guides had the same incorrect format.
(See Also) |
m (.func was formatted wrongly, which lead to a long time where I was having a problem, but couldn't figure out why, since most guides had the same incorrect format.) |
||
| Line 40: | Line 40: | ||
:: info.text = "First Menu Item"; --the text of the menu item | :: info.text = "First Menu Item"; --the text of the menu item | ||
:: info.value = 0; -- the value of the menu item. This can be a string also. | :: info.value = 0; -- the value of the menu item. This can be a string also. | ||
:: info.func = MyDropDownMenuItem_OnClick; --sets the function to execute when this item is clicked | :: info.func = function() MyDropDownMenuItem_OnClick() end; --sets the function to execute when this item is clicked | ||
:: info.owner = this:GetParent(); --binds the drop down menu as the parent of the menu item. This is very important for dynamic drop down menues. | :: info.owner = this:GetParent(); --binds the drop down menu as the parent of the menu item. This is very important for dynamic drop down menues. | ||
:: info.checked = nil; --initially set the menu item to being unchecked with a yellow tick | :: info.checked = nil; --initially set the menu item to being unchecked with a yellow tick | ||
| Line 49: | Line 49: | ||
:: info.text = "Second Menu Item"; | :: info.text = "Second Menu Item"; | ||
:: info.value = 1; | :: info.value = 1; | ||
:: info.func = MyDropDownMenuItem_OnClick | :: info.func = function() MyDropDownMenuItem_OnClick() end; | ||
:: info.owner = this:GetParent(); | :: info.owner = this:GetParent(); | ||
:: info.checked = nil; | :: info.checked = nil; | ||