Lisp HUG Maillist Archive

radio-button-panel problem

I have an application that I want the user to be able to control using the 
keyboard entirely if desired, and in which some radio-button-panel items are 
disabled/enabled under program control. Using the following code, I have a 
problem in using the keyboard to operate the buttons.

When I first display the interface using (capi:display (make-instance 
'rbt-interface)), typing
 the characters 'a', 'b' or 'c' does what I would expect. The first time I 
type 'd', the button for
'd' gets disabled, but subsequently the interface does not respond to any 
keyboard characters. I can reset the behavior by clicking with the mouse on 
the 'a' button, which re-enables the 'd' button for keyboard input, but 
again only for the first typing of the 'd' character.

I can work around this problem by not disabling buttons, and ignoring the 
'd' keyboard character in software, but the problem is that then the user 
has no visual indication that the
'd' button has been disabled.

Does anyone have a better workaround for this problem, which I suspect is a 
CAPI bug?

(capi:define-interface rbt-interface ()
  ()
  (:panes
   (rbp
    capi:radio-button-panel
    :items '(a b c d)
    :accessor rbp
    :selection-callback 'rbt
    :max-width t
    :max-height t))
  (:layouts
   (column-layout-1
    capi:column-layout
    '(rbp)))
  (:default-initargs
   :best-height 13
   :best-width 134
   :layout 'column-layout-1
   :title "Radio Button Panel Test"))

(defun rbt (data interface)
  (print data)
  (cond ((eql data 'd)
         (capi:set-button-panel-enabled-items
          (rbp interface)
          :set nil
          :enable '(a b c)))
        ((eql data 'a)
         (capi:set-button-panel-enabled-items
          (rbp interface)
          :set nil
          :enable '(a b c d)))))

Thanks for your input.

Jim Bushnell 


Re: radio-button-panel problem

Unable to parse email body. Email id is 2767

Updated at: 2020-12-10 08:55 UTC