Skip to content

Commit 2e55bd9

Browse files
authored
Merge pull request #90 from RetiredWizard/main
Replace depreciated .show()
2 parents 968d47d + 37e4576 commit 2e55bd9

22 files changed

+24
-24
lines changed

adafruit_displayio_layout/widgets/cartesian.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Cartesian(Widget):
9898
9999
.. code-block:: python
100100
101-
display.show(my_plane) # add the group to the display
101+
display.root_group = my_plane # add the group to the display
102102
103103
If you want to have multiple display elements, you can create a group and then
104104
append the plane and the other elements to the group. Then, you can add the full
@@ -114,7 +114,7 @@ class Cartesian(Widget):
114114
# Append other display elements to the group
115115
#
116116
117-
display.show(my_group) # add the group to the display
117+
display.root_group = my_group # add the group to the display
118118
119119
120120
**Summary: Cartesian Features and input variables**

adafruit_displayio_layout/widgets/switch_round.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class SwitchRound(Widget, Control):
148148
149149
.. code-block:: python
150150
151-
display.show(my_switch) # add the group to the display
151+
display.root_group = my_switch # add the group to the display
152152
153153
If you want to have multiple display elements, you can create a group and then
154154
append the switch and the other elements to the group. Then, you can add the full
@@ -164,7 +164,7 @@ class SwitchRound(Widget, Control):
164164
# Append other display elements to the group
165165
#
166166
167-
display.show(my_group) # add the group to the display
167+
display.root_group = my_group # add the group to the display
168168
169169
For a full example, including how to respond to screen touches, check out the
170170
following examples in the `Adafruit_CircuitPython_DisplayIO_Layout

adafruit_displayio_layout/widgets/widget.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class Widget(displayio.Group):
122122
The Widget class has several options for setting the widget position on the screen.
123123
In the simplest case, you can define the widget's *.x* and *.y* properties to set
124124
the position. (**Reminder**: If your widget is directly shown by the display using
125-
*display.show(my_widget)*), then the *.x* and *.y* positions will be in the display's
125+
*display.root_group=my_widget*), then the *.x* and *.y* positions will be in the display's
126126
coordinate system. But if your widget is held inside of another Group, then its
127127
coordinates will be in that Group's coordinate system.)
128128

examples/displayio_layout_cartesian_advanced_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
)
7070
my_group.append(car5)
7171

72-
display.show(my_group)
72+
display.root_group = my_group
7373

7474
while True:
7575
pass

examples/displayio_layout_cartesian_lineplot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
my_group = displayio.Group()
3232
my_group.append(my_plane)
33-
display.show(my_group) # add high level Group to the display
33+
display.root_group = my_group # add high level Group to the display
3434

3535
data = [
3636
# (0, 0), # we do this point manually - so we have no wait...

examples/displayio_layout_cartesian_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
my_group = displayio.Group()
3939
my_group.append(my_plane)
40-
display.show(my_group) # add high level Group to the display
40+
display.root_group = my_group # add high level Group to the display
4141

4242
posx = 0
4343
posy = 0

examples/displayio_layout_flip_input_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
my_group.append(my_flip2)
9898
my_group.append(my_flip3)
9999

100-
display.show(my_group) # add high level Group to the display
100+
display.root_group = my_group # add high level Group to the display
101101
display.auto_refresh = True
102102

103103
while True:

examples/displayio_layout_grid_layout_get_cell_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Make the display context
2020
main_group = displayio.Group()
21-
display.show(main_group)
21+
display.root_group = main_group
2222

2323
layout = GridLayout(
2424
x=10,

examples/displayio_layout_gridlayout_dividers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# Make the display context
1919
main_group = displayio.Group()
20-
display.show(main_group)
20+
display.root_group = main_group
2121

2222
layout = GridLayout(
2323
x=10,

examples/displayio_layout_gridlayout_pygame_display_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
display = PyGameDisplay(width=320, height=240)
2020
main_group = displayio.Group()
21-
display.show(main_group)
21+
display.root_group = main_group
2222

2323
layout = GridLayout(
2424
x=10,

examples/displayio_layout_gridlayout_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Make the display context
2020
main_group = displayio.Group()
21-
display.show(main_group)
21+
display.root_group = main_group
2222

2323
layout = GridLayout(
2424
x=10,

examples/displayio_layout_icon_animated_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
main_group.append(icon_zoom)
5353
main_group.append(icon_shrink)
5454

55-
display.show(main_group)
55+
display.root_group = main_group
5656

5757

5858
COOLDOWN_TIME = 0.25

examples/displayio_layout_page_layout_advancedtest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# create and show main_group
2121
main_group = displayio.Group()
22-
display.show(main_group)
22+
display.root_group = main_group
2323

2424
# create the page layout
2525
test_page_layout = PageLayout(x=0, y=0)

examples/displayio_layout_page_layout_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# create and show main_group
2020
main_group = displayio.Group()
21-
display.show(main_group)
21+
display.root_group = main_group
2222

2323
# create the page layout
2424
test_page_layout = PageLayout(x=0, y=0)

examples/displayio_layout_pygame_display_switch_round.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Make the display context
2020
main_group = displayio.Group()
21-
display.show(main_group)
21+
display.root_group = main_group
2222

2323
switch_x = 30
2424
switch_y = 30

examples/displayio_layout_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# Make the display context
2222
main_group = displayio.Group()
23-
display.show(main_group)
23+
display.root_group = main_group
2424

2525
layout = GridLayout(
2626
x=10,

examples/displayio_layout_switch_multiple.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
my_group.append(my_switch8)
103103

104104
# Add my_group to the display
105-
display.show(my_group)
105+
display.root_group = my_group
106106

107107

108108
# Start the main loop

examples/displayio_layout_switch_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
my_group.append(my_switch)
3131

3232
# Add my_group to the display
33-
display.show(my_group)
33+
display.root_group = my_group
3434

3535
# Start the main loop
3636
while True:

examples/displayio_layout_tab_layout_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# create and show main_group
2323
main_group = displayio.Group()
24-
display.show(main_group)
24+
display.root_group = main_group
2525

2626
font = terminalio.FONT
2727

examples/displayio_layout_tab_layout_touchtest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# create and show main_group
3636
main_group = displayio.Group()
37-
display.show(main_group)
37+
display.root_group = main_group
3838

3939
font = terminalio.FONT
4040

examples/hotplug_sensor_examples/displayio_layout_hotplug_rtc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def list(self):
222222

223223
# create and show main_group
224224
main_group = displayio.Group()
225-
display.show(main_group)
225+
display.root_group = main_group
226226

227227
# fon.gvars bitmap_font.load_font("fonts/Helvetica-Bold-16.bdf")
228228
font_arial = bitmap_font.load_font("/fonts/Arial-16.bdf")

examples/hotplug_sensor_examples/displayio_layout_hotplug_temp_sensor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def refresh_from_NTP():
453453
# create and show main_group
454454
main_group = displayio.Group() # The Main Display Group
455455

456-
display.show(main_group)
456+
display.root_group = main_group
457457

458458
# font = bitmap_font.load_font("fonts/Helvetica-Bold-16.bdf")
459459
font_arial = bitmap_font.load_font("/fonts/Arial-16.bdf")

0 commit comments

Comments
 (0)