Reply To: popup menu actions? (how?)

Home Forums General Programming popup menu actions? (how?) Reply To: popup menu actions? (how?)

human fly
  • Topics: 124
  • Replies: 1070
  • Total: 1194
  • ★★★★

hi – ok, i’ve reproduced your code, and i’m getting this error
(what do we call this type of error? syntax?)

At line [-1]: [C]
What: C
Namewhat: method
Name: addColouredItem
Error message: No matching overload found, candidates:
void addColouredItem(PopupMenu&,int,String const&,Colour,bool,bool,Image const&)
void addColouredItem(PopupMenu&,int,String const&,Colour,bool,bool,Drawable*)

am i correct in thinking it is failing at ‘image()’?
here is what my copy of your code looks like:

function colourPop2()

	--This stops issues during panel bootup--else popup will hang startup!
	if panel:getRestoreState() == true or panel:getProgramState() == true 
	then return end

-- Create a table for menu item names
	itemNames = 
	local pMenu	= PopupMenu()

-- Create menu items from the "itemNames" table
	for i=1, #itemNames do
	pMenu:addColouredItem(i, itemNames, Colour(0xff21c630), true, false, Image())
	local ret = pMenu:show(0,0,0,0)

--////////////////////////////////////// MENU ACTIONS /////////////////////////////
-- Return if nothing is selected
	if ret == 0 then 

-- Print the correct name from the "itemNames" table
-- Here you could send the name to a label