1818from types import SimpleNamespace
1919from textual .screen import ModalScreen
2020from textual .app import ComposeResult
21- from textual .containers import Grid , Horizontal , Vertical
21+ from textual .containers import Grid , Horizontal , Vertical , VerticalScroll
2222from textual .widgets import Button , Static , Input , Label , Select , Switch
2323from textual import work , events
2424from tui .messages import (
@@ -178,7 +178,8 @@ def compose(self) -> ComposeResult:
178178 yield Button ("Close" , id = "close_discovery" )
179179 yield Select ([("" , "" )], id = "networks_select" , allow_blank = False )
180180 yield Static ("" , id = "network" )
181- yield Static ("" , id = "results" )
181+ with VerticalScroll (id = "results" ):
182+ yield Static ("" , id = "results_text" )
182183
183184 def on_mount (self ):
184185 select_widget = self .query_one ("#networks_select" , Select )
@@ -232,7 +233,7 @@ def on_select_changed(self, event: Select.Changed) -> None:
232233 async def run_rdm_discovery (self ) -> str :
233234 port = None
234235 try :
235- results_widget = self .query_one ("#results " , Static )
236+ results_widget = self .query_one ("#results_text " , Static )
236237 results_widget .update ("Searching..." )
237238 port = get_port (self .network )
238239 discovered_uids , tn = get_devices (port )
@@ -255,7 +256,6 @@ async def run_rdm_discovery(self) -> str:
255256 @work (thread = True )
256257 async def run_network_discovery (self ) -> str :
257258 try :
258- results_widget = self .query_one ("#results" , Static )
259259 results_widget .update (
260260 f"Searching... timeout is { self .app .configuration .artnet_timeout } sec."
261261 )
@@ -307,7 +307,7 @@ def on_rdm_devices_discovered(self, message: RdmDevicesDiscovered) -> None:
307307 # "software_version_label": "Sw.ver. 4.3",
308308 # "dmx_start_address": 1,
309309 # }
310- results_widget = self .query_one ("#results " , Static )
310+ results_widget = self .query_one ("#results_text " , Static )
311311 if message .devices :
312312 for device in message .devices :
313313 uid = device .get ("uid" , None )
@@ -367,14 +367,14 @@ def on_rdm_device_detail_discovered(
367367 f"{ item .short_name } { f'IP Address: { item .ip_address } ' if item .ip_address else '' } { f'Universe: { item .universe } ' if item .universe else '' } { f'DMX: { item .address } ' if item .address else '' } "
368368 for item in self .discovered_devices
369369 )
370- results_widget = self .query_one ("#results " , Static )
370+ results_widget = self .query_one ("#results_text " , Static )
371371 results_widget .update (
372372 f"[green]Found { len (self .discovered_devices )} :[/green]\n \n { results_text } "
373373 )
374374
375375 def on_network_devices_discovered (self , message : NetworkDevicesDiscovered ) -> None :
376376 devices = []
377- results_widget = self .query_one ("#results " , Static )
377+ results_widget = self .query_one ("#results_text " , Static )
378378 if message .devices :
379379 for device in message .devices :
380380 short_name = device .get ("short_name" , "No Name" )
0 commit comments