In LVGL project without EEZ Flow you can still define user actions that can be attached to the event handlers. You are doing this in 3 steps:
-
Step 1: Add user actions
Go to User Actions tab, press + button, enter the name of user action and press OK:
-
Step 2: Create event handler and attach it to the user action
Select widget, for example Button, and in properties find Events section and press + button:
Now, select event and user action and press OK:
-
Step 3: Implement user action in C
You need to implement in C function called
void action_<user action name>(lv_event_t * e). For example, if user action is calledinc_counteryou need to implementvoid action_inc_counter(lv_event_t * e);. Declaration of all user actions can be found in generated fileactions.h. You can implement user actions in any C file or you can addactions.cfile template in your project like this:
In LVGL project without EEZ Flow you can still define variables that can be used inside widget to add dynamic content. You are doing this in 3 steps:
-
Step 1: Add variable
Go to Variables tab, select Global, press + button, enter the name and type of variable and press OK:
-
Step 2: Use variable inside widget
-
Step 3: Implement get and set functions in C
You need to implement in C, for each variable, functions called
<variable type> get_var_<variable name>()andvoid set_var_<variable name>(<variable_type> value). For example, if variable is calledselected_itemand type isintegeryou need to implementint32_t get_var_selected_item();andvoid set_var_selected_item(int32_t value). Function declarations for all variables can be found in generated filevars.h. You can implement these functions in any C file or you can addvars.cfile template in your project like this:
Downlad SDL (a graphics library to open a window and handle the mouse). On Linux:
- Find the current version of SDL2:
apt-cache search libsdl2 (e.g. libsdl2-2.0-0) - Install SDL2:
sudo apt-get install libsdl2-2.0-0(replace with the found version) - Install SDL2 development package:
sudo apt-get install libsdl2-dev - If build essentials are not installed yet:
sudo apt-get install build-essential
Download the Emscripten SDK and make sure it is in your PATH.
git clone https://github.com/emscripten-core/emsdk.gitcd <path-to-emsdk>git pull./emsdk install latest./emsdk activate latestsource ./emsdk_env.sh
More info here: https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html
cd C:\work\eez\native-interface-lvgl-no-flowmkdir buildcd buildemcmake cmake ..emmake make -j4- A file called
index.htmlwill be generated. Run this in your browser.








