Every widget should have a Create() method. It can take any parameters you want, but must return a Ptr.
| 17 | // Every widget should have a Create() method. |
| 18 | // It can take any parameters you want, but must return a Ptr. |
| 19 | static Ptr Create( const sf::String& label = L"" ) { |
| 20 | auto ptr = Ptr( new MyCustomWidget ); |
| 21 | ptr->SetLabel( label ); |
| 22 | return ptr; |
| 23 | } |
| 24 | |
| 25 | // Every widget must have a GetName() method |
| 26 | // that returns the name of the widget type. |