Hello,
I've been trying to get my list-panes fully operational, but it seems as I take one step forward, something else seems to push me back two steps.
It is frustrating, but I am more grateful to be learning these tools, because this is really the only way I will be exposed to CL. It seems that at first, my lists didn't seem to want to be nonexclusive. I found out that the problem with that was my McCLIM directory in quicklisp had about half of the files missing (?). I don't know how that happened. Then after I figured that out, when I try to update the items of the list using (setf (list-pane-items pane) new-items), it says there is no generic function to handle this. Maybe my problem comes from my work around. This is what I did.
(with-slots (pane) *application-frame* (with-slots (items) pane (setf (climi::list-pane-items (find-pane-named *application-frame* 'pane)) new-items-list)))
Is all of this necessary? It seems the second (with-slots ...) is not necessary.
I've read through the gadgets.lisp and it seems that the defgeneric and defmethods are defined appropriately, but (setf list-pane-items) or (setf climi::list-pane-items) errors out as no generic function. Is there a way better than what I did?
After I use this to update my list, it redisplays with only half of the items; 1500 instead of 3000. Is this a limit of the size that a list-pane can handle; or is this from my work around?
Also I would like to mention, :scroll-bars and :visible-items keys don't work for me. Are these known bugs? When I had :scroll-bars t and tried to update my list, the whole screen became transparent except for around the borders where it was refracted.
P C
P C psilocidal@gmail.com writes:
Hello,
I've been trying to get my list-panes fully operational, but it seems as I take one step forward, something else seems to push me back two steps.
It is frustrating, but I am more grateful to be learning these tools, because this is really the only way I will be exposed to CL. It seems that at first, my lists didn't seem to want to be nonexclusive. I found out that the problem with that was my McCLIM directory in quicklisp had about half of the files missing (?). I don't know how that happened. Then after I figured that out, when I try to update the items of the list using (setf (list-pane-items pane) new-items), it says there is no generic function to handle this. Maybe my problem comes from my work around. This is what I did.
(with-slots (pane) *application-frame* (with-slots (items) pane (setf (climi::list-pane-items (find-pane-named *application-frame* 'pane)) new-items-list)))
Is all of this necessary? It seems the second (with-slots ...) is not necessary.
I've read through the gadgets.lisp and it seems that the defgeneric and defmethods are defined appropriately, but (setf list-pane-items) or (setf climi::list-pane-items) errors out as no generic function. Is there a way better than what I did?
After I use this to update my list, it redisplays with only half of the items; 1500 instead of 3000. Is this a limit of the size that a list-pane can handle; or is this from my work around?
Also I would like to mention, :scroll-bars and :visible-items keys don't work for me. Are these known bugs? When I had :scroll-bars t and tried to update my list, the whole screen became transparent except for around the borders where it was refracted.
Try this instead:
(define-application-frame test () () (:menu-bar t) (:panes (list (make-pane 'list-pane))) (:layouts (default (scrolling (:scroll-bar :vertical) list))))
(define-test-command (com-add-items :name t :menu t) () (let ((list-pane (find-pane-named *application-frame* 'list))) (setf (clim-extensions:list-pane-items list-pane) (loop for i to 3000 collect i))))
(defun test () (run-frame-top-level (make-application-frame 'test)))
Hello Stas,
Thank you for your suggestion.
I tried the code you showed me and it worked on its own, but when I tried to use :
(setf (clim-extensions:list-pane-items list-pane) (loop for i from 0 to (- (list-length new-list) 1) collect (nth i new-list)))
it still only displays half of the list. I collected just i and out of list of 3189, it only displays 1543 ( 0 - 1542 ).
My list is of a bunch of strings.
I am going to look through my code tomorrow and see what I did wrong. Would setting the key arguments when making the list pane affect adjusting the items? Items and value is set at nil, but mode is nonexclusive and test is #'string=.
On Tue, Aug 7, 2012 at 5:52 PM, Stas Boukarev stassats@gmail.com wrote:
Try this instead:
(define-application-frame test () () (:menu-bar t) (:panes (list (make-pane 'list-pane))) (:layouts (default (scrolling (:scroll-bar :vertical) list))))
(define-test-command (com-add-items :name t :menu t) () (let ((list-pane (find-pane-named *application-frame* 'list))) (setf (clim-extensions:list-pane-items list-pane) (loop for i to 3000 collect i))))
(defun test () (run-frame-top-level (make-application-frame 'test)))
-- With best regards, Stas.
P C psilocidal@gmail.com writes:
Hello Stas,
Thank you for your suggestion.
I tried the code you showed me and it worked on its own, but when I tried to use :
(setf (clim-extensions:list-pane-items list-pane) (loop for i from 0 to (- (list-length new-list) 1) collect (nth i new-list)))
Not that it matters for this problem, but that's quite a strange (and slow) way to copy a list, COPY-LIST would work fine, but you don't even need to copy it here.
P C psilocidal@gmail.com writes:
Hello Stas,
Thank you for your suggestion.
I tried the code you showed me and it worked on its own, but when I tried to use :
(setf (clim-extensions:list-pane-items list-pane) (loop for i from 0 to (- (list-length new-list) 1) collect (nth i new-list)))
it still only displays half of the list. I collected just i and out of list of 3189, it only displays 1543 ( 0 - 1542 ).
My list is of a bunch of strings.
I am going to look through my code tomorrow and see what I did wrong. Would setting the key arguments when making the list pane affect adjusting the items? Items and value is set at nil, but mode is nonexclusive and test is #'string=.
If you still haven't resolved your issues, it'd be wise to send your actual code (it's always wise to show the code).
I tinkered with my code, and it was a (spacing (:thickness 0) ... ) argument in the layout for the list.
I appreciate your help. I posted what I thought was applicable in this case.
Here it is for reference.
(define-application-frame stocks-app () () (:geometry :width 1024 :height 768 :left 64 :top 32) (:panes (history-table (make-button-field-table :titles '("Name" "Symbol" "Sector" "Industry" "Date" "Open" "Close" "Volume" "High" "Low") :items '(("DEF" "1" "" "" "2" "X" "5" "6" "7" "8") ("ABC" "3" "" "" "4" "Y" "5" "6" "7" "8") ("GHI" "6" "" "" "5" "Z" "5" "6" "7" "8")) :scroll-bars t)) (index (make-list-pane :id 'index-list :value 'nil :items *index-list* :mode :nonexclusive ;:visible-items 10 doesn't work :prefer-single-selection t :callback 'nil :test #'string=)) (symbols (make-pane 'list-pane)) ; (symbols (make-list-pane ;; supports 1543 items in list , need 3188 to display ; :id 'symbols-list ; :value 'nil ; :items 'nil ; :mode :nonexclusive ; ;:visible-items 10 doesn't work ; :prefer-single-selection t ; :callback 'nil ; ;:scroll-bars t doesn't work ; :test #'string=)) (update-history-button (make-button-pane :id 'update-history :label "Update History")) (download-history-button (make-button-pane :id 'download-history :label "Download History")) (select-stocks-history-button (make-button-pane :id 'select-stocks-history :label "Select Stocks")) (import-history-button (make-button-pane :id 'import-history :label "Import"))) (:layouts (default (with-tab-layout ('tab-page :name 'stocks-layout :height 768) ; Tabs are "History" "Real-Time" ("History" (spacing (:thickness 8) (horizontally (:width 1024) +fill+ (vertically (:height 768) (labelling (:label "History" :height 512 :width 1024) (spacing (:thickness 16) history-table)) (horizontally (:x-spacing 4 :y-spacing 4) (labelling (:label "Indices" :height 128 :width 192) (scrolling (:scroll-bar :vertical) (spacing (:thickness 0) index))) (labelling (:label "Stocks" :height 128) (scrolling (:scroll-bar :vertical) ;; was (scrolling (:thickness 0) symbols))) ;) (horizontally () +fill+ download-history-button update-history-button select-stocks-history-button import-history-button +fill+)) +fill+)))))) (:menu-bar t))
(define-stocks-app-command (com-quit :menu t) () (frame-exit *application-frame*) nil)
(define-stocks-app-command (com-add-items :menu t :name t) () (let ((list-pane (find-pane-named *application-frame* 'symbols)) (index-pane (find-pane-named *application-frame* 'index))) (if (eql (values-list (gadget-value index-pane)) "NYSE") (setf (list-pane-items list-pane) (loop for i from 0 to 3000 collect i)))))
(defvar *stocks-app-frame* nil)
(defun stocks-window () (flet ((run () (let ((frame (make-application-frame 'stocks-app))) (setf *stocks-app-frame* frame) (run-frame-top-level frame)))) (make-thread #'run :name "Stocks Window"))) (stocks-window)
On Wed, Aug 8, 2012 at 9:19 PM, Stas Boukarev stassats@gmail.com wrote:
P C psilocidal@gmail.com writes:
Hello Stas,
Thank you for your suggestion.
I tried the code you showed me and it worked on its own, but when I tried to use :
(setf (clim-extensions:list-pane-items list-pane) (loop for i from 0 to (- (list-length new-list) 1) collect (nth i new-list)))
it still only displays half of the list. I collected just i and out of
list
of 3189, it only displays 1543 ( 0 - 1542 ).
My list is of a bunch of strings.
I am going to look through my code tomorrow and see what I did wrong. Would setting the key arguments when making the list pane affect
adjusting
the items? Items and value is set at nil, but mode is nonexclusive and
test
is #'string=.
If you still haven't resolved your issues, it'd be wise to send your actual code (it's always wise to show the code).
-- With best regards, Stas.