GUIX Templates

I just want to make sure my understanding is right on templates.

Say, I have a template with top bar (header) and body.

Now I insert a template (So.. I go to Insert -> template -> top_bar)

The template contains a window which is the body.

I have data updating in real time that is updated in the top bar using the calls  gx_prompt_text_set(&top_bar.top_bar_prompt_1, result_buffer); 

It seems like the above call does not update the text, but (referencing &window_1.base.top_bar_prompt_1)  gx_prompt_text_set(&window_1.base.top_bar_prompt_1, result_buffer);  works fine and updates the top bar prompts, but the problem is that if I create another screen say window_2 that requires the same top bar and I need to show the same data, then I will have to do gx_prompt_text_set(&window_2.base.top_bar_prompt_1, result_buffer); which seems like for every window that uses that template I will have to update the top bar icons manually in each of their event handlers. 

To overcome this repeated manual update of top bar elements in each window handlers, I deleted the template and now have a top bar window, body window as two different fragments in screen which works perfect with just referencing the top bar elements as for e.g.  &top_bar.top_bar_prompt_1 

Is there a similar way to achieve this functionality of using template with just one place to reference the top bar elements and not inside all window handlers?

My understanding is that GUIX Templates are just place holders for icons, prompts, text boxes but not one place reference for all windows that inherit that template.

 I might be completely wrong on this, So any clarification/inputs on this is much appreciated.

Thanks,

Sam

  • Hello Sam,

    I have created a simple project with a template window defined and run some tests. I agree with you - the solution is to create two separate windows: the top bar and the body, without using a template.

    In my opinion the template functionality is supposed to be used to design elements in the GUIX Studio, which are going to be added to the project multiple times and which should have the same look. Think about a template same as about any predefined GUIX Studio widget, such as: "Text Button", "Prompt", "Circular Gauge" etc. When you add one to the project, it becomes an individual instance (derived instance of the template).

    A big advantage of templates is that you can change (in GUIX Studio) the properties of all these instances at once - by changing the properties of the template only. Please refer to the GUIX Studio documentation for the details:
    GUIX Studio User Guide > Chapter 5 GUIX Studio Screen Designer > Using templates

    You may also find useful the following forum threads:

    I tried to use a similar reference as you did ("top_bar.top_bar_prompt_1"), however I get the "undefined reference to `top_bar'" error message during the compilation. Do you also experience such error message? Which SSP version do you use?

    Best regards,
    anper

  • In reply to anper:

    Hi Anper,
    Thanks for your prompt feedback on this.
    I don't get any error message when I reference as top_bar.top_bar_prompt_1
    I am using SSP 1.1.3 and GUIX 5.3.2.2.

    Thanks,
    Sam
  • In reply to Sam:

    Hello Sam,

    thank you for your feedback.

    I used SSP 1.3.3 and GUIX Studio 5.4.0.0 with GUIX library 5.4.0 to create my project.

    After a short investigation I established that the <project_name>_specifications.c file generated by newer GUIX Studio versions (5.3.3.7+) does not include the template window control block definition. Whereas in case of older GUIX Studio versions (5.3.3.0-) this file does include such definition. This is why you were able to refer to the template window structure, while I was getting an error message.

    Best regards,
    anper

  • In reply to anper:

    Anper,
    That's good to know.

    Thanks for your time on this.

    Sam
  • In reply to anper:

    Hello anper,

    We are suffering the same issue you have described in your previous post. We are updating an old GUIX project created with version 5.3.3.0 and GUIX library 5.3.0 to the new 5.4.1.1 version and library 5.4.0. In this old project we were using templates and the control block definition was created. In the new project this definition is not created ,so we have some errors when compiling our code. Is there any solution to this issue?

    Thanks in advance!

    Imanol
  • In reply to Imanol:

    Hi Imanol,

    I created a new support ticket for you regarding your question. Your ticket number is 194092.
    Our Engineer will get back to you soon.

    Thanks,
    RenesasRulz Forum Moderator
    Jennifer.
  • In reply to Jennifer Zou:

    Hello Jennifer,

    I have not received any communication or email from your Engineers and we are quite in a hurry. Do you have any other suggestion about our question?

    Regards!

    Imanol
  • In reply to Imanol:

    Hi Imanol,

    In this old project we were using templates and the control block definition was created. In the new project this definition is not created ,so we have some errors when compiling our code.

    Here is information which I received from one of the GUIX engineers:

    "It was actually a mistake to define the template control block instance, you aren’t allowed to create an instance of a standalone template. You can create windows based on that template, and the control block for those windows should be defined by GUIX Studio, but there shouldn’t be an instance of the template itself."

    Could you share the build log containing the errors? If possible, please also share the project in which the issue occurs. It would allow to determine which parts of code generate the errors and it would help to investigate the issue.

    Best regards,
    anper

  • In reply to anper:

    Hello anper,

    With the previous version of the SSP (1.2.0) we had this part of code running correctly. The template was created with GUIX and we were using it by calling this line (Tmpl_0_0_BarraStatus is the created template)

    ui8_Status = WGUIX_AttachWidget(p_WindowRoot,(GX_WINDOW *) &Tmpl_0_0_BarraStatus);

    Now we are using SSP1.5.2 and we are having an error with that line, so I have to define it at the start of the file this way:

    TMPL_0_0_BARRASTATUS_CONTROL_BLOCK Tmpl_0_0_BarraStatus;

    With that line there is not error but the functionality is not the correct one. The template appears continuously in the screen.

    Regards

    Imanol
  • In reply to Imanol:

    Hello Imanol,

    it seems that you will need to modify your application code. Please have a look at the attached example project, which shows how templates can be used. You will notice that in the application code there is no reference to the template (window_template). There are only references to the windows based on the template (window3, window4).

    Best regards,
    anper

    GUIApp_Templates_153.zip