Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

accepting values dialog shadows the frame command table #1299

Open
dkochmanski opened this issue Jul 19, 2022 · 0 comments
Open

accepting values dialog shadows the frame command table #1299

dkochmanski opened this issue Jul 19, 2022 · 0 comments
Labels

Comments

@dkochmanski
Copy link
Member

When accepting-values is started, then frame's Command Table is set to accepting-values command table and that makes presentation translators present in the frame's command table not available.

Steps to reproduce:

  1. run the code below
  2. activate the command reader i.e type "Clock In"
  3. select the argument "holy thing" from the screen

Expected:
The translator works and the presentation is translated to the string.

Observed:
The translator is not active, because the command table is "Accepting Values", not "My Frame" (and the translator resides in the latter).

Notes:
When accepting-values is not activated (i.e we type in the interactor "Clock In"), then the command table is not changed and the translator works as expected. Similar when we select the command from menu and there is no interactor present in the frame pane hierarchy.

(in-package #:clim-user)

(defclass holy-thing ()
  ((activep :initarg :activep :accessor activep)))

(defvar *holy-things*
  (list (make-instance 'holy-thing :activep t)
        (make-instance 'holy-thing :activep nil)
        (make-instance 'holy-thing :activep nil)
        (make-instance 'holy-thing :activep t)))

(define-application-frame my-frame ()
  ()
  (:panes (app :application :display-time t
                        :display-function
                        (lambda (f *standard-output*)
                          (declare (ignore f))
                          (dolist (thing *holy-things*)
                            (present thing 'holy-thing)
                            (terpri))))
          (int :interactor)))

(define-presentation-translator holy-thing-to-string (holy-thing string my-frame)
    (interval)
  (format nil "activity is ~s" (activep interval)))

(define-my-frame-command (com-clock-in :name t :menu t)
    ((task 'string))
  (format t "~&Uh oh, the result is: ~s.~%" task))

(find-application-frame 'my-frame)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant