Randy
Member
|
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 |
|
Esenthel
Administrator
|
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 |
|
Randy
Member
|
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 |
|