Dynamically creating objects at runtime that inherit from a base class
Posted
by Homeliss
on Stack Overflow
See other posts from Stack Overflow
or by Homeliss
Published on 2010-04-27T01:46:06Z
Indexed on
2010/04/27
1:53 UTC
Read the original article
Hit count: 276
I am writing a game editor, and have a lot of different "tool" objects. They all inherit from BTool and have the same constructor.
I would like to dynamically populate a toolbox at runtime with buttons that correspond to these tools, and when clicked have them create an instance of that tool and set it as the current tool.
Is this possible, and if so will it be better/easier than creating those buttons by hand?
© Stack Overflow or respective owner