|
34 | 34 | # Tests
|
35 | 35 | text_area = label.Label(terminalio.FONT, text="Circuit Python")
|
36 | 36 | main_group.append(text_area)
|
37 |
| -display.show(main_group) |
| 37 | +display.root_group = main_group |
38 | 38 | time.sleep(TIME_PAUSE)
|
39 | 39 |
|
40 | 40 | # Testing position setter
|
41 | 41 | text_area.x = 10
|
42 | 42 | text_area.y = 10
|
43 |
| -display.show(main_group) |
| 43 | +display.root_group = main_group |
44 | 44 | time.sleep(TIME_PAUSE)
|
45 | 45 |
|
46 | 46 | # Testing creating label with initial position
|
|
57 | 57 | background_color=0x004499,
|
58 | 58 | )
|
59 | 59 | main_group.append(warning_text)
|
60 |
| -display.show(main_group) |
| 60 | +display.root_group = main_group |
61 | 61 | time.sleep(TIME_PAUSE)
|
62 | 62 |
|
63 | 63 | text_area.text = "Testing Position"
|
64 | 64 | text_middle = label.Label(
|
65 | 65 | terminalio.FONT, text="Circuit", x=display.width // 2, y=display.height // 2
|
66 | 66 | )
|
67 | 67 | main_group.append(text_middle)
|
68 |
| -display.show(main_group) |
| 68 | +display.root_group = main_group |
69 | 69 | time.sleep(TIME_PAUSE)
|
70 | 70 |
|
71 | 71 | # Testing Text Setter
|
72 | 72 | text_area.text = "Testing Changing Text"
|
73 | 73 | text_middle.text = "Python"
|
74 |
| -display.show(main_group) |
| 74 | +display.root_group = main_group |
75 | 75 | time.sleep(TIME_PAUSE)
|
76 | 76 |
|
77 | 77 | # Testing a and y getter and setter
|
78 | 78 | text_area.text = "Testing Changing Position"
|
79 | 79 | text_middle.x = text_middle.x - 50
|
80 | 80 | text_middle.y = text_middle.y - 50
|
81 |
| -display.show(main_group) |
| 81 | +display.root_group = main_group |
82 | 82 | time.sleep(TIME_PAUSE)
|
83 | 83 |
|
84 | 84 | # Testing font Getter and setter
|
85 | 85 | text_area.text = "Testing Changing FONT"
|
86 | 86 | if isinstance(text_middle.font, fontio.BuiltinFont):
|
87 | 87 | text_middle.font = MEDIUM_FONT
|
88 |
| -display.show(main_group) |
| 88 | +display.root_group = main_group |
89 | 89 | time.sleep(TIME_PAUSE)
|
90 | 90 |
|
91 | 91 | # Once this working we create another label with all the initial specs
|
|
100 | 100 | y=display.height // 2,
|
101 | 101 | )
|
102 | 102 | main_group.append(text_initial_specs)
|
103 |
| -display.show(main_group) |
| 103 | +display.root_group = main_group |
104 | 104 | time.sleep(TIME_PAUSE)
|
105 | 105 |
|
106 | 106 | text_initial_specs.color = 0x004400
|
107 |
| -display.show(main_group) |
| 107 | +display.root_group = main_group |
108 | 108 | time.sleep(TIME_PAUSE)
|
109 | 109 | main_group.pop()
|
110 | 110 |
|
|
118 | 118 | color=0xFFFFFF,
|
119 | 119 | )
|
120 | 120 | main_group.append(text_initial_specs)
|
121 |
| -display.show(main_group) |
| 121 | +display.root_group = main_group |
122 | 122 | time.sleep(TIME_PAUSE)
|
123 | 123 |
|
124 | 124 | text_initial_specs.background_color = 0x990099
|
125 |
| -display.show(main_group) |
| 125 | +display.root_group = main_group |
126 | 126 | time.sleep(TIME_PAUSE)
|
127 | 127 | main_group.pop()
|
128 | 128 |
|
|
148 | 148 | background_tight=False,
|
149 | 149 | )
|
150 | 150 | main_group.append(text_initial_specs)
|
151 |
| -display.show(main_group) |
| 151 | +display.root_group = main_group |
152 | 152 | time.sleep(TIME_PAUSE)
|
153 | 153 | main_group.pop()
|
154 | 154 | main_group.pop()
|
|
168 | 168 | padding_left=10,
|
169 | 169 | )
|
170 | 170 | main_group.append(text_initial_specs)
|
171 |
| -display.show(main_group) |
| 171 | +display.root_group = main_group |
172 | 172 | time.sleep(TIME_PAUSE)
|
173 | 173 | main_group.pop()
|
174 | 174 |
|
|
187 | 187 | padding_left=10,
|
188 | 188 | )
|
189 | 189 | main_group.append(text_initial_specs)
|
190 |
| -display.show(main_group) |
| 190 | +display.root_group = main_group |
191 | 191 | time.sleep(TIME_PAUSE)
|
192 | 192 |
|
193 | 193 | try:
|
|
206 | 206 | )
|
207 | 207 | main_group.append(warning_text)
|
208 | 208 | time.sleep(TIME_PAUSE)
|
209 |
| - display.show(main_group) |
| 209 | + display.root_group = main_group |
210 | 210 |
|
211 | 211 | main_group.pop()
|
212 | 212 |
|
|
227 | 227 | anchor_point=(0.5, 0.5),
|
228 | 228 | )
|
229 | 229 | main_group.append(text_initial_specs)
|
230 |
| -display.show(main_group) |
| 230 | +display.root_group = main_group |
231 | 231 | time.sleep(TIME_PAUSE)
|
232 | 232 |
|
233 | 233 | text_initial_specs.scale = 2
|
234 |
| -display.show(main_group) |
| 234 | +display.root_group = main_group |
235 | 235 | time.sleep(TIME_PAUSE)
|
236 | 236 | main_group.pop()
|
237 | 237 |
|
|
257 | 257 | base_alignment=True,
|
258 | 258 | )
|
259 | 259 | main_group.append(text_initial_specs)
|
260 |
| -display.show(main_group) |
| 260 | +display.root_group = main_group |
261 | 261 | time.sleep(TIME_PAUSE)
|
262 | 262 | main_group.pop()
|
263 | 263 | main_group.pop()
|
|
280 | 280 | label_direction="UPR",
|
281 | 281 | )
|
282 | 282 | main_group.append(text_initial_specs)
|
283 |
| -display.show(main_group) |
| 283 | +display.root_group = main_group |
284 | 284 | time.sleep(TIME_PAUSE)
|
285 | 285 | main_group.pop()
|
286 | 286 |
|
|
301 | 301 | label_direction="DWR",
|
302 | 302 | )
|
303 | 303 | main_group.append(text_initial_specs)
|
304 |
| -display.show(main_group) |
| 304 | +display.root_group = main_group |
305 | 305 | time.sleep(TIME_PAUSE)
|
306 | 306 | main_group.pop()
|
307 | 307 |
|
|
322 | 322 | label_direction="TTB",
|
323 | 323 | )
|
324 | 324 | main_group.append(text_initial_specs)
|
325 |
| -display.show(main_group) |
| 325 | +display.root_group = main_group |
326 | 326 | time.sleep(TIME_PAUSE)
|
327 | 327 | main_group.pop()
|
328 | 328 |
|
|
343 | 343 | label_direction="RTL",
|
344 | 344 | )
|
345 | 345 | main_group.append(text_initial_specs)
|
346 |
| -display.show(main_group) |
| 346 | +display.root_group = main_group |
347 | 347 | time.sleep(TIME_PAUSE)
|
348 | 348 | main_group.pop()
|
349 | 349 |
|
350 | 350 | main_group.pop()
|
351 | 351 |
|
352 | 352 | # Testing creating label with initial position
|
353 |
| -display.show(main_group) |
| 353 | +display.root_group = main_group |
354 | 354 | time.sleep(TIME_PAUSE)
|
355 | 355 | text_area = bitmap_label.Label(terminalio.FONT, text="Circuit Python")
|
356 | 356 | main_group.append(text_area)
|
357 |
| -display.show(main_group) |
| 357 | +display.root_group = main_group |
358 | 358 | time.sleep(TIME_PAUSE)
|
359 | 359 | # Testing position setter
|
360 | 360 | text_area.x = 10
|
361 | 361 | text_area.y = 10
|
362 |
| -display.show(main_group) |
| 362 | +display.root_group = main_group |
363 | 363 | time.sleep(TIME_PAUSE)
|
364 | 364 | text_area.text = "Testing initiating without text"
|
365 | 365 | try:
|
|
381 | 381 | terminalio.FONT, text="Circuit", x=display.width // 2, y=display.height // 2
|
382 | 382 | )
|
383 | 383 | main_group.append(text_middle)
|
384 |
| -display.show(main_group) |
| 384 | +display.root_group = main_group |
385 | 385 | time.sleep(TIME_PAUSE)
|
386 | 386 |
|
387 | 387 | # Testing Text Setter
|
388 | 388 | text_area.text = "Testing Changing Text"
|
389 | 389 | text_middle.text = "Python"
|
390 |
| -display.show(main_group) |
| 390 | +display.root_group = main_group |
391 | 391 | time.sleep(TIME_PAUSE)
|
392 | 392 |
|
393 | 393 | # Testing a and y getter and setter
|
394 | 394 | text_area.text = "Testing Changing Position"
|
395 | 395 | text_middle.x = text_middle.x - 50
|
396 | 396 | text_middle.y = text_middle.y - 50
|
397 |
| -display.show(main_group) |
| 397 | +display.root_group = main_group |
398 | 398 | time.sleep(TIME_PAUSE)
|
399 | 399 |
|
400 | 400 | # Testing font Getter and setter
|
401 | 401 | text_area.text = "Testing Changing FONT"
|
402 | 402 | if isinstance(text_middle.font, fontio.BuiltinFont):
|
403 | 403 | print("Font was BuiltinFont")
|
404 | 404 | text_middle.font = MEDIUM_FONT
|
405 |
| -display.show(main_group) |
| 405 | +display.root_group = main_group |
406 | 406 | time.sleep(TIME_PAUSE)
|
407 | 407 |
|
408 | 408 | # Once this working we create another label with all the initial specs
|
|
417 | 417 | y=display.height // 2,
|
418 | 418 | )
|
419 | 419 | main_group.append(text_initial_specs)
|
420 |
| -display.show(main_group) |
| 420 | +display.root_group = main_group |
421 | 421 | time.sleep(TIME_PAUSE)
|
422 | 422 |
|
423 | 423 | text_initial_specs.color = 0x004400
|
424 |
| -display.show(main_group) |
| 424 | +display.root_group = main_group |
425 | 425 | time.sleep(TIME_PAUSE)
|
426 | 426 | main_group.pop()
|
427 | 427 |
|
|
435 | 435 | color=0xFFFFFF,
|
436 | 436 | )
|
437 | 437 | main_group.append(text_initial_specs)
|
438 |
| -display.show(main_group) |
| 438 | +display.root_group = main_group |
439 | 439 | time.sleep(TIME_PAUSE)
|
440 | 440 |
|
441 | 441 | text_initial_specs.background_color = 0x990099
|
442 |
| -display.show(main_group) |
| 442 | +display.root_group = main_group |
443 | 443 | time.sleep(TIME_PAUSE)
|
444 | 444 | main_group.pop()
|
445 | 445 |
|
|
465 | 465 | background_tight=False,
|
466 | 466 | )
|
467 | 467 | main_group.append(text_initial_specs)
|
468 |
| -display.show(main_group) |
| 468 | +display.root_group = main_group |
469 | 469 | time.sleep(TIME_PAUSE)
|
470 | 470 | main_group.pop()
|
471 | 471 | main_group.pop()
|
|
485 | 485 | padding_left=10,
|
486 | 486 | )
|
487 | 487 | main_group.append(text_initial_specs)
|
488 |
| -display.show(main_group) |
| 488 | +display.root_group = main_group |
489 | 489 | time.sleep(TIME_PAUSE)
|
490 | 490 | main_group.pop()
|
491 | 491 |
|
|
504 | 504 | padding_left=10,
|
505 | 505 | )
|
506 | 506 | main_group.append(text_initial_specs)
|
507 |
| -display.show(main_group) |
| 507 | +display.root_group = main_group |
508 | 508 | time.sleep(TIME_PAUSE)
|
509 | 509 |
|
510 | 510 | try:
|
|
523 | 523 | )
|
524 | 524 | main_group.append(warning_text)
|
525 | 525 | time.sleep(TIME_PAUSE)
|
526 |
| - display.show(main_group) |
| 526 | + display.root_group = main_group |
527 | 527 |
|
528 | 528 | main_group.pop()
|
529 | 529 |
|
|
544 | 544 | anchor_point=(0.5, 0.5),
|
545 | 545 | )
|
546 | 546 | main_group.append(text_initial_specs)
|
547 |
| -display.show(main_group) |
| 547 | +display.root_group = main_group |
548 | 548 | time.sleep(TIME_PAUSE)
|
549 | 549 |
|
550 | 550 | text_initial_specs.scale = 2
|
551 |
| -display.show(main_group) |
| 551 | +display.root_group = main_group |
552 | 552 | time.sleep(TIME_PAUSE)
|
553 | 553 | main_group.pop()
|
554 | 554 |
|
|
574 | 574 | base_alignment=True,
|
575 | 575 | )
|
576 | 576 | main_group.append(text_initial_specs)
|
577 |
| -display.show(main_group) |
| 577 | +display.root_group = main_group |
578 | 578 | time.sleep(TIME_PAUSE)
|
579 | 579 | main_group.pop()
|
580 | 580 | main_group.pop()
|
|
597 | 597 | label_direction="UPR",
|
598 | 598 | )
|
599 | 599 | main_group.append(text_initial_specs)
|
600 |
| -display.show(main_group) |
| 600 | +display.root_group = main_group |
601 | 601 | time.sleep(TIME_PAUSE)
|
602 | 602 | main_group.pop()
|
603 | 603 |
|
|
618 | 618 | label_direction="DWR",
|
619 | 619 | )
|
620 | 620 | main_group.append(text_initial_specs)
|
621 |
| -display.show(main_group) |
| 621 | +display.root_group = main_group |
622 | 622 | time.sleep(TIME_PAUSE)
|
623 | 623 | main_group.pop()
|
624 | 624 |
|
|
639 | 639 | label_direction="UPD",
|
640 | 640 | )
|
641 | 641 | main_group.append(text_initial_specs)
|
642 |
| -display.show(main_group) |
| 642 | +display.root_group = main_group |
643 | 643 | time.sleep(TIME_PAUSE)
|
644 | 644 | main_group.pop()
|
645 | 645 |
|
|
660 | 660 | label_direction="RTL",
|
661 | 661 | )
|
662 | 662 | main_group.append(text_initial_specs)
|
663 |
| -display.show(main_group) |
| 663 | +display.root_group = main_group |
664 | 664 | time.sleep(TIME_PAUSE)
|
665 | 665 | main_group.pop()
|
666 | 666 |
|
|
0 commit comments