34 views
in GUI Development by
Hello,

I am totally new to EW graphic design, just started learning by Quick Tour. But meet a simple question: cannot add Method Init{} in Application::Application composer page.

I click Application class to open a new Composer page. In the top-left corner of the Composer you see the Canvas area. Beside of Canvas is " property rect Bounds", no more things.

According to QuickTour example project "CoffeeMachine", there should be a " Method Init{}" on this page. And in the Inspector window, you can see the Init{} is there, order is 68.

But in my new Application Composer page, in Inspector Window, the order 68, I can see Init{} but it is grey, not available. I added new Method and want to changed name to "Init{}", the whole Method appears red color, looks wrong.

I think the Init{} should be importance and be use to start the project. So, could you give me a suggestion, how to add the method Init{}.

Thank you so much.

June

1 Answer

0 votes
by

Hello June,

when you open the class Application::Application of Quick Tour, you should see the Init method just below the Canvas area:

Generally, the Init method (as well as Done and ReInit) is available in every class. You can see it in the Inspector window. Therefore when you add a new method and try to name it Init, you will consequently get an error message since such member already exists.

With new created components (your own Application class as example), the Init method does not appear in Composer. It is not yet overriden in the respective class. You need to override it first. How you do this is explained in the section Override inherited Init() method.

Best regards

Paul Banach

 

by

Thank you so much Paul,

Like you said, I can see Init method just below the Canvas area in QuickTour. But why I cannot see this Init method below the Canvas are in my own new project when I open the class Application::Application. ( see below image) , I do not know whether there is no Init{}, the project would not start ?

In the inspector window, I can see the inherit Init method, I confused is: I did not write any method, only created a new project and opened application, but the Init method did not show below the Canvas automatically like QuickTour, why it shows inherit? 

Do I need to override it and rename this method like "start", because I cannot use the name "Init."

by

Hello June,

if we are talking about your own component, all the members listed in Inspector are inherited from one of the base classes. They appear therefore with thin gray font. It includes also the Init method. When you want to implement the Init method, you have to override it explicitly. See the section Method: Constructor Init(). Thereupon the member Init in Inspector will appear in thick gray font (see also: Inspector: Members area) and a brick for the Init method appears in Composer.

Does it help you?

Best regards

Paul Banach

by
Thanks a bunch, Paul.

Completely understood and it works. Really appreciate your help.

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

...