@@ -154,6 +154,26 @@ fn createDigitButtons(cont: *c.lv_obj_t) !void {
154
154
}
155
155
}
156
156
157
+ /// Labels for Call and Cancel Buttons
158
+ const call_labels = [_ ][]const u8 { "Call" , "Cancel" };
159
+
160
+ /// Labels for Digit Buttons
161
+ const digit_labels = [_ ][]const u8 { "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "*" , "0" , "#" };
162
+
163
+ /// LVGL Display Text (Null-Terminated)
164
+ var display_text = std .mem .zeroes ([64 :0 ]u8 );
165
+
166
+ /// LVGL Display Label
167
+ var display_label : lvgl.Label = undefined ;
168
+
169
+ /// LVGL Styles for Containers (std.mem.zeroes crashes the compiler)
170
+ var display_style : c.lv_style_t = undefined ;
171
+ var call_style : c.lv_style_t = undefined ;
172
+ var digit_style : c.lv_style_t = undefined ;
173
+
174
+ ///////////////////////////////////////////////////////////////////////////////
175
+ // Handle Events
176
+
157
177
/// Handle LVGL Button Event
158
178
/// https://docs.lvgl.io/8.3/examples.html#simple-buttons
159
179
export fn eventHandler (e : ? * c.lv_event_t ) void {
@@ -198,23 +218,6 @@ export fn eventHandler(e: ?*c.lv_event_t) void {
198
218
}
199
219
}
200
220
201
- /// Labels for Call and Cancel Buttons
202
- const call_labels = [_ ][]const u8 { "Call" , "Cancel" };
203
-
204
- /// Labels for Digit Buttons
205
- const digit_labels = [_ ][]const u8 { "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "*" , "0" , "#" };
206
-
207
- /// LVGL Display Text (Null-Terminated)
208
- var display_text = std .mem .zeroes ([64 :0 ]u8 );
209
-
210
- /// LVGL Display Label
211
- var display_label : lvgl.Label = undefined ;
212
-
213
- /// LVGL Styles for Containers (std.mem.zeroes crashes the compiler)
214
- var display_style : c.lv_style_t = undefined ;
215
- var call_style : c.lv_style_t = undefined ;
216
- var digit_style : c.lv_style_t = undefined ;
217
-
218
221
///////////////////////////////////////////////////////////////////////////////
219
222
// Imported Functions and Variables
220
223
0 commit comments