File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -329,8 +329,10 @@ def __init__(
329329 self ,
330330 width : int = 400 ,
331331 height : int = 300 ,
332- title : int = "Tkinter Graphics Window" ,
332+ title : str = "Tkinter Graphics Window" ,
333333 ) -> None :
334+ if not (os .environ .get ("DISPLAY" ) or os .name == "nt" ):
335+ raise RuntimeError ("No display detected. GUI cannot be initialized" )
334336 self .root = tk .Tk ()
335337 self .root .title (title )
336338 self .width = width
@@ -501,9 +503,6 @@ def render(self) -> None:
501503 Launch the interactive 3D cube renderer.
502504 A window will appear; use keyboard controls to move and rotate camera.
503505 """
504- # Only run GUI if display is available
505- if os .environ .get ("DISPLAY" ) or os .name == "nt" :
506- win = GraphicsWindow ()
507- win .mainloop ()
508- else :
509- print ("No display detected. Skipping GUI launch." )
506+
507+ win = GraphicsWindow ()
508+ win .mainloop ()
You can’t perform that action at this time.
0 commit comments