My CLIM Kung Fu is not so great, but it seems a slot on the application frame might be more to your liking? I would be interested if there is some better, more canonical approach...<div><br></div><div>-jm<br><div><br><div class="gmail_quote">
On Sun, Sep 23, 2012 at 4:36 AM, Kilian Sprotte <span dir="ltr"><<a href="mailto:kilian.sprotte@gmail.com" target="_blank">kilian.sprotte@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I made a simple implementation of prompt-for-items-from-list. Any<br>
comments? In particular, I am wondering if :items *items* using a<br>
special variable is the only way to initialize the list-pane.<br>
<br>
Regards,<br>
Kilian<br>
<br>
(defvar *items*)<br>
<br>
(define-application-frame items-from-list ()<br>
((exit-command :accessor exit-command))<br>
(:menu-bar t)<br>
(:panes<br>
(list (make-pane 'list-pane<br>
:mode :nonexclusive<br>
:items *items*)))<br>
(:layouts<br>
(default<br>
(scrolling (:scroll-bar :vertical)<br>
list))))<br>
<br>
(macrolet ((frob (command)<br>
`(define-items-from-list-command (,command :name t :menu t) ()<br>
(setf (exit-command *application-frame*) ',command)<br>
(frame-exit *application-frame*))))<br>
(frob com-ok)<br>
(frob com-cancel))<br>
<br>
(defun prompt-for-items-from-list (items)<br>
(flet ((get-list-pane (frame)<br>
(find-pane-named frame 'list)))<br>
(let* ((*items* items)<br>
(frame (make-application-frame 'items-from-list)))<br>
(run-frame-top-level frame)<br>
(ecase (exit-command frame)<br>
(com-ok<br>
(values (gadget-value (get-list-pane frame))<br>
t))<br>
(com-cancel<br>
(values nil<br>
nil))))))<br>
<br>
<br>
_______________________________________________<br>
mcclim-devel mailing list<br>
<a href="mailto:mcclim-devel@common-lisp.net">mcclim-devel@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel</a><br>
</blockquote></div><br></div></div>