pierre
04-20-2004, 07:11 AM
Hi all:
I have some codes as below:
-- Show a popup menu at the coordinates of a lable object called "Label1"
tblPos = Label.GetPos("Label1");
tblSize =Label.GetSize("Label1");
x = tblPos.X;
y = tblPos.Y + tblSize.Height;
tblMenu =
{
{text="Apple",type=0,checked=false,enabled=true},
{text="Orange",type=0,checked=false,enabled=true},
{text="Pear",type=0,checked=false,enabled=true},
{text="Banana",type=0,checked=false,enabled=true},
{text="SEP",type=1,checked=false,enabled=true},
{text="Mango",type=0,checked=true,enabled=true},
{text="Pineapple (Not Available)",type=0,
checked=false,enabled=false}
};
strSelected = PopupMenu.Show(tblMenu,x,y,
PopupMenu.HALIGN_LEFT,PopupMenu.VALIGN_TOP);
if (strSelected ~= "CANCELLED") then
Dialog.Message("Selected Fruit",strSelected);
end
I had installed the Popup Menu plugin.
When I review these codes, it will show "attempt to index global 'tbPos' (a nil value).
How can I modify upon codes that it reaches my purpose? Who can help me solve the issue ASAP? Thank you for advance.
I have some codes as below:
-- Show a popup menu at the coordinates of a lable object called "Label1"
tblPos = Label.GetPos("Label1");
tblSize =Label.GetSize("Label1");
x = tblPos.X;
y = tblPos.Y + tblSize.Height;
tblMenu =
{
{text="Apple",type=0,checked=false,enabled=true},
{text="Orange",type=0,checked=false,enabled=true},
{text="Pear",type=0,checked=false,enabled=true},
{text="Banana",type=0,checked=false,enabled=true},
{text="SEP",type=1,checked=false,enabled=true},
{text="Mango",type=0,checked=true,enabled=true},
{text="Pineapple (Not Available)",type=0,
checked=false,enabled=false}
};
strSelected = PopupMenu.Show(tblMenu,x,y,
PopupMenu.HALIGN_LEFT,PopupMenu.VALIGN_TOP);
if (strSelected ~= "CANCELLED") then
Dialog.Message("Selected Fruit",strSelected);
end
I had installed the Popup Menu plugin.
When I review these codes, it will show "attempt to index global 'tbPos' (a nil value).
How can I modify upon codes that it reaches my purpose? Who can help me solve the issue ASAP? Thank you for advance.