This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Tivaware Grlib Image Update for ImageButton

Other Parts Discussed in Thread: EK-TM4C123GXL, TIDM-TM4C129POEAUDIO

Hello All,

I am using Tivaware grahics library (grlib) on TM4C123 microcontroller along with QVGA TFT LCD for my Project.

I am using "RectButtonStruct" to define buttons on my screen and through touch i/p I am moving to other screen(through pfnOnClick). everything works fine. Now the problem I am facing is when I define both "pui8Image" and "pui8PressImage" in my button structure with different Images, The image changes to pressed image and I am navigating to next screen after that when I come back to my 1st screen The button Image is still "pui8PressImage" instead of "pui8Image" though the button is already released. so How to change the Button Image to "pui8Image" when I traverse Back.

- Next is If I want to retain My pressed Image depend on another press event,i.e The previously pressed Image should retain its image(pressedImage) till another button is pressed? How to do this? 

(One workaround I found is using some external user defined flags, But this is not a feasible solution for me as I have many screens any many buttons, Monitoring all the flags will kill my performance.)

Any Help will be Highly Appreciated!! :-)

Thank you.

-Nagendra.

  • Hello Nagaendra,

    I have not seen an issue like this with the GrLib. Can you check the GrLib example of grlib_demo in the installed TivaWare path.

    TivaWare_C_Series-2.1.3.156\examples\boards\ek-tm4c123gxl-boostxl-kentec-s1\grlib_demo

    This is with the EK-TM4C123GXL launchpad and the KENTEC Booster Pack.
  • HI Amit,
    I am using a "RectangularButtonStruct" looks exactly shown in grlib_demo:
    RectangularButtonStruct(g_psPanels + 5, g_psPushButtons + 3, 0,
    &g_sKentec320x240x16_SSD2119, 130, 30, 50, 50,
    PB_STYLE_IMG | PB_STYLE_TEXT, 0, 0, 0, ClrSilver,
    &g_sFontCm22, "5", g_pui8Blue50x50,
    g_pui8Blue50x50Press, 0, 0, OnButtonPress)
    and I am enclosing all the buttons of a screen in "tPushButtonWidget array[]"
    Now inside "OnButtonPress" I am going to new screen, ans from That coming back to main screen, Now the button defined above is with g_pui8Blue50x50Press instead of g_pui8Blue50x50.

    My question is do we need to set any PB_Flags to change it back to original Image?
  • Hello Nagaendra

    I think the issue is in the manner in which you are parsing the buttons from an array to the Button Structure. I have a similar use scenario with TIDM-TM4C129POEAUDIO but I do not use a structure and I never ran into such an issue.