About Store Forum Documentation Contact



Post Reply 
How to create gui object?
Author Message
Randy Offline
Member

Post: #1
How to create gui object?
I want manually create gui objects such as Text, Button, etc.
Working method is:

Code:
Text * txt = new Text;
txt->create("text");

but it's strange for me - why engine not using ordinary constructors like

Code:
Text * txt = new Text("text");

insteed of create() ?
10-03-2011 02:47 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: How to create gui object?
because new is slower, requires memory allocation, pointer management, and manual releasing
current system is much better
10-03-2011 03:53 PM
Find all posts by this user Quote this message in a reply
Randy Offline
Member

Post: #3
RE: How to create gui object?
(10-03-2011 03:53 PM)Esenthel Wrote:  because new is slower, requires memory allocation, pointer management, and manual releasing
current system is much better

What do you mean by the term 'current system' ?
'new' and 'create' requires 2 lines of code (and probably causes memory loss), 'new' - only one.
And how create new objects without memory allocation?
10-03-2011 05:17 PM
Find all posts by this user Quote this message in a reply
Post Reply