Random behaviour with GUIX gx_checkbox_select()

Hi,

I'm experienceing a random behaviour when trying to configure some checkboxes by calling 'gx_checkbox_select'. Sometimes all checkboxes are correctly set sometimes only one in group is set, sometimes 2 or 3... So each time you visit the configuration window the result can be different.

 

What is suprising to me is that all the other similar functions I'm using to configure my views are updating components without any problem. Currently I'm using 'gx_widget_fill_color_set', 'gx_pixelmap_prompt_pixelmap_set', 'gx_text_button_text_set' and 'gx_prompt_text_set' without any problem.

 

Thanks,

Oscar.

  • Hi Oscar,

    Could you provide some code showing how gx_checkbox_select is used in your code? Are checkboxes your using direct children to the top-level window or are there any intermediate widgets in the widget tree?

    Which SSP/GUIX Studio version are you using?

    Regards
  • In reply to Renesas Karol:

    Hi Karol,

    Following you have the details of my implementation using SSP 1.7.0 and GUIX 5.4.1.

    The data updating is made asynchronously before to show up the window (as I'm successfully performing with many prompt's, pixel prompt's and text buttons on different windows), the window is shown by attaching it to the root_window object.

    This is the window structure:

     

    The code is as follows:

    void guiap_helpers_configurationWindow_002_ui_set_check(int16_t param_id, char *value)
    {
    GX_WIDGET *p_widget = 0x00;
    if(value[0] == '0')
    {
    return;
    }

    switch (param_id)
    {
    case bccfg002_A_checkbox:
    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_A_config;
    break;
    case bccfg002_B_checkbox:
    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_B_config;
    break;
    case bccfg002_C_checkbox:
    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_C_config;
    break;
    case bccfg002_D_checkbox:
    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_D_config;
    break;
    case bccfg002_E_checkbox:
    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_E_config;
    break;

    default:
    return;
    }

    guiap_helpers_update_element_check_interface(p_widget);
    }

     

     

    void guiap_helpers_update_element_check_interface(GX_WIDGET *p_widget)
    {
    ssp_err_t err = GX_SUCCESS;
    if (p_widget == 0x00)
    return;

    err = gx_checkbox_select(p_widget);
    if (err)
    {
    system_debug_log(__FILE__, __LINE__, err);
    }
    }

    Thank you in advance.

    Oscar

     

     

  • In reply to Oscar:

    Hello Oscar,

    When addressing children as parent struct members typically "parent_a.parent_a_widget_b" member is used, where parent_a is a top-level parent for the widget and widget_b is the symbol for the widget we're looking to access. From the GUIX Studio configuration, it would appear that you need to use ConfigurationWindow_002.ConfigurationWindow_002_checkBox_A however your code uses ConfigurationWindow_002.ConfigurationWindow_002_checkBox_A_config member (with "config" at the end). Please try removing _config suffix to see if checkboxes respond correctly to your function calls.

    Regards
  • In reply to Renesas Karol:

    Dear Karol,

    Yes you're rigth. There is amistake in my post, apologize for that :-(.

    Actually the function calls are made exactly as you said:

    void guiap_helpers_configurationWindow_002_ui_set_check(int16_t param_id, char *value)

    {

    GX_WIDGET *p_widget = 0x00;

    if(value[0] == '0')

    {

    return;

    }

    switch (param_id)

    {

    case bccfg002_A_checkbox:

    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_A;

    break;

    case bccfg002_B_checkbox:

    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_B;

    break;

    case bccfg002_C_checkbox:

    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_C;

    break;

    case bccfg002_D_checkbox:

    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_D;

    break;

    case bccfg002_E_checkbox:

    p_widget = &ConfigurationWindow_002.ConfigurationWindow_002_checkBox_E;

    break;

    default:

    return;

    }

  • In reply to Oscar:

    Hi Karol,
    Any suggestion about checkboxes issue?
    Thanks,

    Oscar.

  • In reply to Oscar:

    Hi Oscar.

    Nothing obvious seems to stand out from your code as the function call is correct. gx_checkbox_select is very simple too as it applies/removes GX_STYLE_BUTTON_PUSHED widget style and emits GX_SIGNAL to parent. I suspect there's something else in the application (perhaps some widget event handler) that's causing these issues.

    Regards
  • In reply to Renesas Karol:

    Karol,

    Here is the root cause "...and emits GX_SIGNAL to parent...". In my code when receive this event I interpret the user is performing a configuration. So it results on some kind of auto checking loop.

    I have to figure how to amend it, but, thanks a lot by the way, you has given me the clue ;-)

    Thanks a lot!
    Oscar.

    PD:
    I also have an pending question on different threrad, can you take a look? Thanks!
    renesasrulz.com/.../flickering-on-display-with-single-frame-buffer
  • In reply to Oscar:

    Karol,
    Finally the solution has been to control the GX_STYLE_BUTTON_PUSHED directly by using 'gx_widget_style_remove' and 'gx_widget_style_add' on the checkbox widget elements.

    Thanks for your help.
    Oscar.