[mcclim-devel] Gadgets in accepting-values (again)

Anthony Juckel ajuckel at gmail.com
Tue Mar 22 12:58:43 UTC 2005


With the latest McCLIM CVS, displaying a gadget within
accepting-values seems to work quite well now.  Unfortunately, I feel
that I'm doing something wrong with the functionality.  At first, I
tried to simply call throw-object-ptype from my gadget's
value-changed-callback (it inherits from value-gadget), but that
seemed to have no effect.  The function was called, but I'm unsure how
that thrown value was supposed to propogate.  Who is supposed to
"catch" it?  I finally settled on the following to get my value
properly propogated:

    :value-changed-callback
    #'(lambda (gadget value)
        (declare (ignore gadget))
        (let ((query (find query-identifier
                             (climi::queries climi::*accepting-values-stream*)
                             :key #'climi::query-identifier :test #'equal)))
            (setf (climi::value query) value)
            (setf (climi::changedp query) t))
        (climi::throw-object-ptype value `(trait-rating ,max))
        (debug-msg "Gadget value changed to: ~A" value))

The throw-object-ptype at near the bottom of the callback remains, but
doesn't appear to do anything.  This method strikes me as quite
unclean for a few reasons, not the least of which is relying on a few
unexported symbols from clim-internals.

One other thing:  com-select-query is not called during the operation
of my gadget.  Looking at the behavior of the popup menu, I see that
it is displayed as a simple value until the query is selected, at
which point select-query blocks waiting for the user to make a choice
from the newly-drawn popup menu.  I'm not sure how to do functionality
similar to that in my case.  The user may at any time click my gadget
to change its value, and I am unsure how to tie in select-query for
two reasons:

1)  I still don't quite get presentation-to-command-translators, so I
don't know how I can make any click on my gadget also translate into
com-select-query, as well as having the click register with my gadget
to properly change its value.

2)  Even if I get com-select-query to be called, I'm unsure how I
would block within select-query until the user selects a value in the
query.

Could anyone help me shed some light on these issues?

Anthony W. Juckel



More information about the mcclim-devel mailing list