File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
shared-bindings/displayio Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -423,8 +423,24 @@ STATIC mp_obj_t displayio_display_obj_get_root_group(mp_obj_t self_in) {
423
423
}
424
424
MP_DEFINE_CONST_FUN_OBJ_1 (displayio_display_get_root_group_obj , displayio_display_obj_get_root_group );
425
425
426
- MP_PROPERTY_GETTER (displayio_display_root_group_obj ,
427
- (mp_obj_t )& displayio_display_get_root_group_obj );
426
+ STATIC mp_obj_t displayio_display_obj_set_root_group (mp_obj_t self_in , mp_obj_t group_in ) {
427
+ displayio_display_obj_t * self = native_display (self_in );
428
+ displayio_group_t * group = NULL ;
429
+ if (group_in != mp_const_none ) {
430
+ group = MP_OBJ_TO_PTR (native_group (group_in ));
431
+ }
432
+
433
+ bool ok = common_hal_displayio_display_show (self , group );
434
+ if (!ok ) {
435
+ mp_raise_ValueError (translate ("Group already used" ));
436
+ }
437
+ return mp_const_none ;
438
+ }
439
+ MP_DEFINE_CONST_FUN_OBJ_2 (displayio_display_set_root_group_obj , displayio_display_obj_set_root_group );
440
+
441
+ MP_PROPERTY_GETSET (displayio_display_root_group_obj ,
442
+ (mp_obj_t )& displayio_display_get_root_group_obj ,
443
+ (mp_obj_t )& displayio_display_set_root_group_obj );
428
444
429
445
430
446
//| def fill_row(self, y: int, buffer: WriteableBuffer) -> WriteableBuffer:
You can’t perform that action at this time.
0 commit comments