DropDown Menus
I have been trying to create a wrapper function to make a dropdown list by using a table as the master container. I can get the main level to populate but not the following lists.
I am trying to make it run off the following table layout: menuList = {text, hasArrow, function, menuList} it will parse through and use the text and function if hasArrow is false. Otherwise it runs through the text and hasArrow and menuList. The examples I found otherwise I havent been able to adapt to work. Mainly because I dont fully understand the level building for sublevels. |
Have you consulted this guide?
|
Quote:
I tried to replace the elseif menuList == "Games" and make it instead: Code:
else |
If someone can help out with a more direct function running off a table I would appreciate it. I just had one more idea I am going to try and if it works I will post it back here.
Otherwise I will still be looking. |
Quote:
Following Requires: menuList, SubList with texts in menuList as keys. Code:
local info = UIDropDownMenu_CreateInfo() |
So my new question becomes...:
How can I make that function infinitely nesting? Heres the sample table I used in the function above: Code:
testMenuList = {Greetings = {"Greetings", true, {"hi", "hello", "good day"}}, Farewells = {"Farewells", true, {"bye", "goodbye", "later"}}} |
You can't create infinite menus by using system features. Try some drop down menu libs or just create one yourself.
Like http://forums.wowace.com/showthread.php?t=18946 |
Rather than inventing your own special table format, just use the existing EasyMenu format as described in the thread Torhal linked (scroll down to post #4). It allows you to pass your table directly to the menu system.
|
Quote:
|
Nevermind I just got it off a random idea that happened to work.
For all of you to see and test here is the code: Code:
function IOLib_CreateDropDown(parent, name, title, width, anchor, posX, posY, menuList, OnClick) Code:
testMenuList = {{"Greetings", true, {{"Hi", true, {{"H", true, {{"Amazing", false, nil}}},{"i", false, nil}}}, |
Quote:
|
Quote:
|
Quote:
Code:
print(SomeVar) -- error because SomeVar is not defined yet Code:
do |
Quote:
|
Quote:
#2 - A scoping problem does not necessarily mean you have a syntax error. You are allowed to refer to a variable that isn't defined -- the end result is the same as if you'd explicitly defined the variable with a value of nil -- and you are allowed to pass nil to functions. #3 - The error points to whichever line in Blizzard's code tries to do something with the value you passed into the function. If the value is nil at that point, it was also nil (or some other non-table value) when you passed it. This, again, points to a scoping issue within your code, or a misnamed variable. #4 - Four years of college and you're still using the term "code error" and don't understand how a stack trace works? Really? I tried to give you a second chance here, despite the fact that your previous posts have made it quite clear that you don't really want help. You're always right, you never make mistakes, you know everything, and every line of code you write is perfect just the way it is. Carry on. :rolleyes: |
Quote:
At this point I am sick of you. You only seem to mock those that dont worship you as a god. You arent. Sure I dont know about stack traces as it wasnt taught. I know I coded it right as some were copies from source that failed as a test. DO not reply back. I know I wont reply back to you. There is absolutely no reason for you to be this smug and arrogant when I already stated I had solved my issue when no one else could and I never said I needed help with EasyMenu. I simply wont use it. |
All times are GMT -6. The time now is 06:41 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI