@@ -74,10 +74,10 @@ def set_backlight(val):
7474
7575
7676# ------------- Display Groups ------------- # 
77- splash  =  displayio .Group (max_size = 15 )  # The Main Display Group 
78- view1  =  displayio .Group (max_size = 15 )  # Group for View 1 objects 
79- view2  =  displayio .Group (max_size = 15 )  # Group for View 2 objects 
80- view3  =  displayio .Group (max_size = 15 )  # Group for View 3 objects 
77+ splash  =  displayio .Group ()  # The Main Display Group 
78+ view1  =  displayio .Group ()  # Group for View 1 objects 
79+ view2  =  displayio .Group ()  # Group for View 2 objects 
80+ view3  =  displayio .Group ()  # Group for View 3 objects 
8181
8282def  hideLayer (hide_target ):
8383    try :
@@ -98,11 +98,11 @@ def showLayer(show_target):
9898pyportal .set_background ('/images/loading.bmp' )
9999
100100
101- bg_group  =  displayio .Group (max_size = 1 )
101+ bg_group  =  displayio .Group ()
102102splash .append (bg_group )
103103
104104
105- icon_group  =  displayio .Group (max_size = 1 )
105+ icon_group  =  displayio .Group ()
106106icon_group .x  =  180 
107107icon_group .y  =  120 
108108icon_group .scale  =  1 
@@ -122,13 +122,15 @@ def set_image(group, filename):
122122    if  not  filename :
123123        return   # we're done, no icon desired 
124124
125+     # CircuitPython 6 & 7 compatible 
125126    image_file  =  open (filename , "rb" )
126127    image  =  displayio .OnDiskBitmap (image_file )
127-     try :
128-         image_sprite  =  displayio .TileGrid (image , pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()))
129-     except  TypeError :
130-         image_sprite  =  displayio .TileGrid (image , pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()),
131-                                           position = (0 , 0 ))
128+     image_sprite  =  displayio .TileGrid (image , pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()))
129+ 
130+     # # CircuitPython 7+ compatible 
131+     # image = displayio.OnDiskBitmap(filename) 
132+     # image_sprite = displayio.TileGrid(image, pixel_shader=image.pixel_shader) 
133+ 
132134    group .append (image_sprite )
133135
134136set_image (bg_group , "/images/BGimage.bmp" )
@@ -143,28 +145,28 @@ def set_image(group, filename):
143145TABS_Y  =  50 
144146
145147# Text Label Objects 
146- feed1_label  =  Label (font , text = "Text Wondow 1" , color = 0xE39300 ,  max_glyphs = 200 )
148+ feed1_label  =  Label (font , text = "Text Wondow 1" , color = 0xE39300 )
147149feed1_label .x  =  TABS_X 
148150feed1_label .y  =  TABS_Y 
149151view1 .append (feed1_label )
150152
151- feed2_label  =  Label (font , text = "Text Wondow 2" , color = 0xFFFFFF ,  max_glyphs = 200 )
153+ feed2_label  =  Label (font , text = "Text Wondow 2" , color = 0xFFFFFF )
152154feed2_label .x  =  TABS_X 
153155feed2_label .y  =  TABS_Y 
154156view2 .append (feed2_label )
155157
156- sensors_label  =  Label (font , text = "Data View" , color = 0x03AD31 ,  max_glyphs = 200 )
158+ sensors_label  =  Label (font , text = "Data View" , color = 0x03AD31 )
157159sensors_label .x  =  TABS_X 
158160sensors_label .y  =  TABS_Y 
159161view3 .append (sensors_label )
160162
161- sensor_data  =  Label (font , text = "Data View" , color = 0x03AD31 ,  max_glyphs = 100 )
163+ sensor_data  =  Label (font , text = "Data View" , color = 0x03AD31 )
162164sensor_data .x  =  TABS_X + 15 
163165sensor_data .y  =  170 
164166view3 .append (sensor_data )
165167
166168
167- text_hight  =  Label (font , text = "M" , color = 0x03AD31 ,  max_glyphs = 10 )
169+ text_hight  =  Label (font , text = "M" , color = 0x03AD31 )
168170# return a reformatted string with word wrapping using PyPortal.wrap_nicely 
169171def  text_box (target , top , string , max_chars ):
170172    text  =  pyportal .wrap_nicely (string , max_chars )
0 commit comments