@@ -142,28 +142,28 @@ fn createDisplayLabel(cont: *c.lv_obj_t) !void {
142
142
var container = lvgl .Object .init (cont );
143
143
144
144
// Create a Label Widget
145
- var label = try container .createLabel ();
145
+ display_label = try container .createLabel ();
146
146
147
147
// Wrap long lines in the label text
148
- label .setLongMode (c .LV_LABEL_LONG_WRAP );
148
+ display_label .setLongMode (c .LV_LABEL_LONG_WRAP );
149
149
150
150
// Interpret color codes in the label text
151
- label .setRecolor (true );
151
+ display_label .setRecolor (true );
152
152
153
153
// Center align the label text
154
- label .setAlign (c .LV_TEXT_ALIGN_CENTER );
154
+ display_label .setAlign (c .LV_TEXT_ALIGN_CENTER );
155
155
156
156
// Set the label text and colors
157
- label .setText ("#ff0000 HELLO# " ++ // Red Text
157
+ display_label .setText ("#ff0000 HELLO# " ++ // Red Text
158
158
"#00aa00 LVGL ON# " ++ // Green Text
159
159
"#0000ff PINEPHONE!# " // Blue Text
160
160
);
161
161
162
162
// Set the label width
163
- label .setWidth (200 );
163
+ display_label .setWidth (200 );
164
164
165
165
// Align the label to the top middle
166
- label .alignObject (c .LV_ALIGN_TOP_MID , 0 , 0 );
166
+ display_label .alignObject (c .LV_ALIGN_TOP_MID , 0 , 0 );
167
167
}
168
168
169
169
/// Create the Call and Cancel Buttons
@@ -212,6 +212,9 @@ export fn eventHandler(e: ?*c.lv_event_t) void {
212
212
}
213
213
}
214
214
215
+ /// LVGL Display Label
216
+ var display_label : lvgl.Label = undefined ;
217
+
215
218
/// LVGL Styles for Containers (std.mem.zeroes crashes the compiler)
216
219
var display_style : c.lv_style_t = undefined ;
217
220
var call_style : c.lv_style_t = undefined ;
0 commit comments