emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] widget-field-overlay becomes wrong


From: Lars Hansen
Subject: Re: [BUG] widget-field-overlay becomes wrong
Date: Fri, 09 Jul 2004 23:10:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk

Per Abrahamsen wrote:
I could not make fields work correctly unless they were separated by
some text, so that was a a basic restriction in the design.  It should
be documented as such.

One more comment on the subject.

From what you write, and from what is in the manual, it suffices that "fields are surrounded by static text". However that is not enough. The text may not be part of another widget. Even worse, in the programming example, this rule is broken! So if you run the example, you will see the "bug" i reported (click the Choose button).

The patch attached should correct these problems.
*** emacs/LH-work/widget/widget-1.26.texi       Thu Apr 29 21:25:31 2004
--- cvsroot/emacs/man/widget.texi       Fri Jul  9 22:54:45 2004
***************
*** 213,219 ****
  
  Editable text fields are created by the @code{editable-field} widget.
  
! An editable field must be surrounded by static text on both sides, that
  is, text that does not change in the lifetime of the widget.  If the
  field extends to the end of the line, the terminating line-feed character
  will count as the necessary static text on that end, but you will have
--- 213,220 ----
  
  Editable text fields are created by the @code{editable-field} widget.
  
! In an @code{editable-field} widget, the editable field must be
! surrounded by static text on both sides, that
  is, text that does not change in the lifetime of the widget.  If the
  field extends to the end of the line, the terminating line-feed character
  will count as the necessary static text on that end, but you will have
***************
*** 221,226 ****
--- 222,229 ----
  @code{:format} keyword is useful for generating the static text; for
  instance, if you give it a value of @code{"Name: %v"}, the "Name: " part
  will count as the static text.
+ Observe that static text belonging to another widget does @emph{not}
+ count, however text inserted with @code{widget-insert} does.
  
  The editing text fields are highlighted with the
  @code{widget-field-face} face, making them easy to find.
***************
*** 345,350 ****
--- 348,354 ----
    (widget-insert "Here is some documentation.\n\nName: ")
    (widget-create 'editable-field
                 :size 13
+                :format "%v " ; Static text after the field!
                 "My Name")
    (widget-create 'menu-choice
                 :tag "Choose"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]