From 6163526fd2eaf1c062f4093c2f93191e4cbe7f7b Mon Sep 17 00:00:00 2001 From: Anthony Cook Date: Wed, 11 Oct 2023 12:38:19 -0500 Subject: [PATCH] Screens can be named too --- lib/remedy/screen.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/remedy/screen.rb b/lib/remedy/screen.rb index bfffe39..1ecf823 100644 --- a/lib/remedy/screen.rb +++ b/lib/remedy/screen.rb @@ -16,7 +16,7 @@ class Screen # @param auto_resize [Boolean] can be disabled if you are setting up your own console resize hook # @see #resize # @see Console.set_console_resized_hook! - def initialize auto_resize: true, auto_redraw: true + def initialize auto_resize: true, auto_redraw: true, name: object_id @mainframe = Frame.new name: "screen#init", parent: self mainframe.fill = "." mainframe.size = :fill @@ -26,7 +26,7 @@ def initialize auto_resize: true, auto_redraw: true resize new_size, redraw: auto_redraw end if auto_resize end - attr_accessor :mainframe + attr_accessor :mainframe, :name # Draw the buffer to the console using raw output. # @param override [Remedy::Frame,String] temporarily replace the contents with this instead (until the next redraw!)