About Store Forum Documentation Contact
Donations:
140$/mo



Post Reply 
Gui Objects create method
Author Message
Khanser Offline
Member

Post: #1
Gui Objects create method
Hi,

I was trying to give the Button struct a little bit Object Oriented style for dynamic event calling of objects inheriting the Button struct when I got to this create(rect,text) method returning a Button. At first I thought "ok, this.create(r,t) will update whatever is inside this Object Button because i'm calling this method using the <this> clause". So in the constructor of my object I called to this.create(rect,text) and in the test I made, the object doesn't appear. However if I add the returned object of the create function then obviously the button appears.

So why do we have to declare a Button to actually call a method that creates another (and real) Button? Why the constructors don't have the same params as the create method and the create methods become static so they call the constructors(that has to actually create the object)?
Am I missing something? :/

Thanks for your time smile
(This post was last modified: 12-01-2011 12:14 AM by Khanser.)
11-30-2011 06:03 PM
Find all posts by this user Quote this message in a reply
Post Reply