General it's a Tizen Framework problem. Suggest you have UI application with one button. The application structure will be following:
UIApp : [ Frame : [ Form : [ Button ] ] ]
and the initialization call chain for this simple UI will be following:
OnAppInitializing():
new Frame() => Frame.Construct() =>
AddFrame(frame):
Frame.OnInitializing():
new Form() => Form.Construct() =>
AddControl(form):
Form.OnInitializing():
new Button() => Button.Construct() =>
AddControl(button):
Button.OnInitializing()
The reason for this: object constructor does nothing (as Tizen doesn't use exceptions) and the real job is done by Construct() method. We can get the same result by using custom objects which will use constructors and exception.
OnAppInitializing():
new Frame():
Frame.Construct()
new Form():
Form.Construct()
new Button():
Button.Construct()
AddControl(button)
AddControl(form)
AddFrame(frame)
This is what I wanted to do.
In point of view of Tizen framework we should get the same result as before every AddFrame()/AddControl()
function call we have valid chain new Object() => Object.Construct() => AddControl(Object)
.
But the problem, probably is that when on my phone I get the same result, log is different:
04-05 02:18:04.840 : ERROR / Tizen::Ui::Controls ( 16130 : 16130 ) : Tizen::Ui::Animations::_VisualElement* Tizen::Ui::Controls::_IndicatorManager::GetIndicatorVisualElement(Tizen::Ui::_Window*, Tizen::Ui::Controls::_IndicatorOrientation, Tizen::Ui::_Control*) const(132) > [E_SYSTEM] Unable to get Indicator
04-05 02:18:04.840 : ERROR / Tizen::Ui::Controls ( 16130 : 16130 ) : result Tizen::Ui::Controls::_Indicator::AddIndicatorObject(Tizen::Ui::_Control*, Tizen::Ui::_Window*)(373) > [E_SYSTEM] Indicator can not create the surface.
04-05 02:18:04.840 : ERROR / Tizen::Ui::Controls ( 16130 : 16130 ) : Tizen::Ui::Animations::_VisualElement* Tizen::Ui::Controls::_IndicatorManager::GetIndicatorVisualElement(Tizen::Ui::_Window*, Tizen::Ui::Controls::_IndicatorOrientation, Tizen::Ui::_Control*) const(132) > [E_SYSTEM] Unable to get Indicator
04-05 02:18:04.840 : ERROR / Tizen::Ui::Controls ( 16130 : 16130 ) : result Tizen::Ui::Controls::_Indicator::AddIndicatorObject(Tizen::Ui::_Control*, Tizen::Ui::_Window*)(373) > [E_SYSTEM] Indicator can not create the surface.
04-05 02:18:04.840 : ERROR / Tizen::Ui ( 16130 : 16130 ) : result Tizen::Ui::_Control::SetFocused(bool)(2634) > [E_INVALID_OPERATION] This control should have a parent or be attached to the main tree.
Thus I think Tizen Framework can doesn't support my approach very well.