Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] use offscreen lines for textfield overflow
@ 2008-11-23 20:59 Steve Goldman
  2008-11-27  0:33 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Goldman @ 2008-11-23 20:59 UTC (permalink / raw)


In the To:, Cc:, Bcc:, etc., prompts, the TextField was initializing
an NCurses form with zero offscreen lines.  So when the user typed too
many addresses at the prompt the cursor wrapped around and everything
they had typed was clobbered.  This patch initializes the form object
to have 256 offscreen lines (I had no rationale for 256 except that it
is a nice, big power of two).  Now the user can type plenty of names
and the wrap-around works as the user would expect.
---
 lib/sup/textfield.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
index 479c609..c748c7a 100644
--- a/lib/sup/textfield.rb
+++ b/lib/sup/textfield.rb
@@ -33,7 +33,7 @@ class TextField
     @w, @y, @x, @width = window, y, x, width
     @question = question
     @completion_block = block
-    @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 0, 0
+    @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
     @form = Ncurses::Form.new_form [@field]
     @value = default
     Ncurses::Form.post_form @form
-- 
1.5.6.4
-- 

Steve Goldman
sgoldman at tower-research.com

T: 212.219.6014
F: 212.219.6007

Tower Research Capital, LLC
377 Broadway, 11th Fl.
New York, NY 10013


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-27  0:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-23 20:59 [sup-talk] [PATCH] use offscreen lines for textfield overflow Steve Goldman
2008-11-27  0:33 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox