483 views
in GUI Development by

Hi,

I have a screen, with a GUI component in it (my own widget). The GUI component (Widget) on the parent screen has bounds <0,280,800,480>, but the actual widget (internally) has bounds <0,0,800,300>

I would like to be able to resize the (internal) GUI components bounds <0,0,800,300> so that it would fit properly inside <0,280,800,480>, and have this done at runtime.

Trying to achive this brought me to my second question;

I am overriding the init functions for both the screen and the GUI component (Widget). I would like to have my screens init called before the GUI components (Widgets) init, as I would like to set up properties that are required by the (Widgets) init function. How can I change the order init functions are called in?

Thanks,

Oliver

1 Answer

0 votes
by

Hello Oliver,

do I assume correcly, that the Widget components are embedded inside the Screen components? If this is the case, the order in which the Init methods are invoked is pre-determined. Precisely: when an object is created, all other objects embedded inside it are initialized before. As soon as all embedded objects have finalized their initialization, the superior object can perform its own initialization.

This is essential, otherwise the superior object would be able to perform operations and access embedded objects, which are not yet initialized. 

Without knowing your exact application case I would suggest two ideas:

1. In the superior component (the Screen?) use the UpdateLayout() method to adjust/arrange the embedded Widget components.

2. Use within the Init method the postsignal statement to defer operations. See my answer in ReInit method called in different order in simulation and in target.

If the problem is releated to the initialization of sibling objects (e.g. components coexisting within the same owner component) , their initialization order does correspond to the order in which the objects are listed in Inspector. Please see: Members area and Reorder members.

Does it help you further?

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...