Skip to main content
Ciuffoly
Senior
November 29, 2019
Question

[SOLVED] Is there a method to update the text in the screen from the main() ?

  • November 29, 2019
  • 1 reply
  • 438 views

Also adding these includes it is impossible to modify text in the screen or select a button from the main.cpp - main() - while(1) { }

/* USER CODE BEGIN Includes */

#include <stm32746g_discovery_qspi.h>

#include <gui/screen1_screen/Screen1View.hpp>

#include <gui_generated/screen1_screen/Screen1ViewBase.hpp>

/* USER CODE END Includes */

/* Start scheduler */

   osKernelStart();

   /* We should never get here as control is now taken by the scheduler */

   /* Infinite loop */

   /* USER CODE BEGIN WHILE */

   while (1)

   {

       /* USER CODE END WHILE */

       Screen1View().setIRBuffer("pippo"); <<<<< NEVER GO HERE !!!

       /* USER CODE BEGIN 3 */

   }

   /* USER CODE END 3 */

    This topic has been closed for replies.

    1 reply

    Ciuffoly
    CiuffolyAuthor
    Senior
    November 29, 2019

    Add the code in Screen1View.cpp where thare are the other touch events like Screen1View::buttonUpClicked().

    void Screen1View::handleTickEvent()

    {

       if (key == 1) // received event from HW like infrared receiver

       {

           touchgfx::Unicode::snprintf(IRBuffer, IR_SIZE, "Test IR");

           IR.setWildcard(IRBuffer);

           IR.resizeToCurrentText();

           IR.invalidate();

           key = 0;

       }

    }