577 views
in GUI Development by
The programming language Chora offers three different types of signals: signal, postsignal and idlesignal. I'm looking for some overview for the intention, the processing and some practical use-cases of the different signal types.

1 Answer

0 votes
by

Signals are tailor-made to notify a single object about a certain event or change in the system. Each of the three different signal types can be sent in the Chora code to either a property of type 'slot' or to a 'slot method' e.g.:

signal slot-method;
signal slot-property;

If there is no slot method assigned to a slot property, the signals have no effect – neither a call of a method nor a runtime error occurs. Now let’s have a more detailed look on the different signal types.

  • signal
    A signal causes an immediate, synchronous call of a slot method. The hidden argument "sender" in a slot method provides the object of the sender. A typical use-case for a signal is a button who should react immediately on a user input, a slider that immediately changes a value (volume, brightness,…) or a menu item that opens a sub-menu.
  • postsignal
    Postsignals are queued in a signal queue. They are executed in the order as they occurred. Multiple postsignals to the same recipient are merged to one single postsignal inserted at the end of the queue. The hidden argument 'sender' is always 'null' due to the fact that it could be merged from two or more sender. Postsignals are executed with some delay, but always before the next screen update. As long as a postsignal is pending in the queue, related objects will not be removed by the Garbage Collector. A typical use-case for a postsignal is the optimization (only one call from many merged postsignals instead of many calls from many signals to the same recipient) and to avoid initialization effects due to dependencies on the z-order.
  • idlesignal
    The only difference between an idlesignal and a postsignal is the execution time. An idlesignal is execuded after the next screen update if there is no user input. A typical use-case for a idlesignal is to serve time intensive tasks such as JPG decoding or a channel scan in the background. With idlesignals the UI application can respond to the user inputs and the main Software gets enough processing time while the UI task split a time consuming process in multiple small idle steps.

For more information please have a look to Chora User Manual - chapters 'signal' statement, 'postsignal' statement and 'idlesignal' statement.

  •  

Embedded Wizard Website | Privacy Policy | Imprint

...