PDA

View Full Version : Help with the creation of an object and respond to the option On Click


homes
03-27-2008, 07:26 PM
I think this OBJECT_BUTTON of the form:
tblButtonPos = {};
tblButtonPos.Opacity = 75;
tblButtonPos.Left = 300;
tblButtonPos.Top = 15;
tblButtonPos.GetState = BTN_UP;
tblButtonPos.Enabled = true;
tblButtonPos.Visible = true;
tblButtonPos.X = 160;
tblButtonPos.Y = 20;
tblButtonPos.Width = 500;
tblButtonPos.Height = 25;
tblButtonPos.Cursor = HAND;

for n=1, 4 do
-- Create the 4 object Button
Page.CreateObject(OBJECT_BUTTON, "XPBarButton"..n, tblButtonPos);

end

I can I respond to the following code?:


if Button.GetState("XPBarButton"..n) == BTN_DOWN then
SetGroupVisible("grp"..n, true)
else
SetGroupVisible("grp"..n, false)
end

---I would be very grateful for their collaboration

holtgrewe
03-28-2008, 07:28 AM
homes

You probably want to use the Page.SetObjectScript(ObjectName, EventName, Script) for each object right after creating the buttons. That could set the OnClick event for the buttons...

I hope that's what you're looking for...