Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

GUIX Custom Signals handling

$
0
0

I would like to understand/clarify my doubts on custom signal emitting/handling between GUIX layer (UI Layer) and Main Thread (Business Logic Layer) for better coding practices and long term code reliability.

1. For generating events on Main Thread, I do the following:

Main Thread Snippet::::

              enum {

                EVENT_1 = GX_FIRST_APP_EVENT + 1,

                EVENT_2 = GX_FIRST_APP_EVENT + 2

              };

.................

               GX_EVENT gx_custom_event = {0};

               gx_custom_event.gx_event_type = EVENT_1;

               gx_system_event_send (&gx_custom_event);

 

GUIX HMI Thread Snippet::::

             UINT MainScreenEventHandler(GX_WINDOW * widget, GX_EVENT * event_ptr)
            {
                  switch (event_ptr->gx_event_type)
                 {
                        case GX_EVENT_SHOW:
                                 return gx_window_event_process(widget, event_ptr);
                        break;

                        case EVENT_1:

                               //change multi text color to green

                         break;

                         default:
                               return gx_window_event_process(widget, event_ptr);
                 }

           return 0;

        }

Questions::::

1. Is this the correct way to generate and handle events from main thread to guix thread?

2. If I do this, the event is not getting called inside the GUIX thread switch case even though that is the active window and Enabled, Accept focus properties are set.

 

Any thoughts on this is greatly appreciated. Thanks. 

SSP Version 1.1.3

e2 Studio Version 5.4.0.015

GUIX Studio Version 5.3.2.2

 

    


Viewing all articles
Browse latest Browse all 5781

Trending Articles