sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 0746918f33ef248b89802294bf9bed0f2604ac64
parent aaa384af6ec7054f5e16086b1e54b8f3740723a6
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Mon,  1 Mar 2010 15:26:52 -0800

support older ncurses gems without opts_off

Diffstat:
M lib/sup/textfield.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
@@ -34,8 +34,10 @@ class TextField
     @question = question
     @completion_block = block
     @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 0, 0
-    @field.opts_off Ncurses::Form::O_STATIC
-    @field.opts_off Ncurses::Form::O_BLANK
+    if @field.respond_to? :opts_off
+      @field.opts_off Ncurses::Form::O_STATIC
+      @field.opts_off Ncurses::Form::O_BLANK
+    end
     @form = Ncurses::Form.new_form [@field]
     @value = default || ''
     Ncurses::Form.post_form @form