Книга: Embedded Linux development using Eclipse

Creating an Event Procedure

Creating an Event Procedure

In order for our new button to actually do something, we have to attach it to an event procedure. With the Hello button selected in the Editor, click the Add procedure icon in the Procedures view to bring up the dialog in Figure 6.16. Name the function “hello_button” and select ACTIVATE as the trigger.


Figure 6.16: NAB Create Procedure dialog.

Clicking OK creates a new .cpp file with a template for the hello_button() function. In the source code Editor, enter the following line in the hello_button() function:

object->setProperty(WSNlabelString, "Hello from NAB");

When you save the revised hello_button.cpp file, the project is rebuilt. Now we have a program that does something.

Оглавление книги


Генерация: 1.178. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз