Board index » cppbuilder » Add Action to TActionList at runtime?

Add Action to TActionList at runtime?

Hi to all!
Please, help me to add Action to TActionList at runtime.

Thanks.
Moshiach now!

 

Re:Add Action to TActionList at runtime?


Quote
"Brusilovsky Yeshaya" <sh...@lipman.co.il> wrote in message

news:3e114b44@newsgroups.borland.com...

Quote
> Please, help me to add Action to TActionList at runtime.

A TActionList is really just a design-time tool to help organize the
creation and maintenance of actions.  There is no real benefit to adding a
new TAction to an action list at runtime unless you intend to iterate the
actions in the action list yourself at runtime.

With that said, when you create your new TAction you just need to specify
the owner.  For instance:

    TAction* action = new TAction(ActionList1);

But as I mentioned above you don't need to have an action list to
dynamically create and maintain a new TAction.  You can just as easily pass
the main form as the owner for your new action.

HTH,
- Clayton

Other Threads