Lisp HUG Maillist Archive

Very tall CAPI:DISPLAY-PANEs and vertical scroll

I want to display a few hundred lines of text in a window.

Using a CAPI:EDITOR-PANE, I can do this:


(defparameter *multi-line-text*
  (with-output-to-string (s)
    (loop for i from 1 to 1000
          do (format s "~&Line ~A~%" i))))

(capi:contain
 (make-instance 'capi:editor-pane
                :text *multi-line-text*
                :horizontal-scroll t
                :vertical-scroll t)
 :best-x 0
 :best-y 0
 :best-width 600
 :best-height 800)


The above works ok except that it allows the text to be
edited by the user. Having :ENABLED NIL for the editor pane
disables the editing but it also disables the scroll bar.

I suppose I should really be using CAPI:DISPLAY-PANE. But
when I try that I have problems:


;; Same as above, except use a CAPI:DISPLAY-PANE instead
;; of a CAPI:EDITOR-PANE
(capi:contain
 (make-instance 'capi:display-pane
                :text *multi-line-text*
                :horizontal-scroll t
                :vertical-scroll t)
 :best-x 0
 :best-y 0
 :best-width 600
 :best-height 800)

;; Try using :VISIBLE-MAX-HEIGHT for the CAPI:DISPLAY-PANE
(capi:contain
 (make-instance 'capi:display-pane
                :text *multi-line-text*
                :horizontal-scroll t
                :vertical-scroll t
                :visible-max-height 800)
 :best-x 0
 :best-y 0)


In both case, the resulting window is too high to fit on the screen.

Any ideas?

BTW, similar things happen with very wide text, but that's not causing
me any grief.



RE: Very tall CAPI:DISPLAY-PANEs and vertical scroll

Hi simon,

don't ask me why, but just add an :visible-min-height constraint, and your
display-pane should be ok.

(capi:contain
 (make-instance 'capi:display-pane
                :text *multi-line-text*
                :horizontal-scroll t
                :vertical-scroll t
                :visible-max-height 800
		    :visible-min-height '(:character 5)))

Cheers,
Sebastien.


> -----Message d'origine-----

> De : owner-lisp-hug@xanalys.com [mailto:owner-lisp-hug@xanalys.com]De la
> part de Simon Katz
> Envoye : mardi 28 septembre 2004 18:30
> A : lisp-hug@xanalys.com
> Objet : Very tall CAPI:DISPLAY-PANEs and vertical scroll
>
>
> I want to display a few hundred lines of text in a window.
>
> Using a CAPI:EDITOR-PANE, I can do this:
>
>
> (defparameter *multi-line-text*
>   (with-output-to-string (s)
>     (loop for i from 1 to 1000
>           do (format s "~&Line ~A~%" i))))
>
> (capi:contain
>  (make-instance 'capi:editor-pane
>                 :text *multi-line-text*
>                 :horizontal-scroll t
>                 :vertical-scroll t)
>  :best-x 0
>  :best-y 0
>  :best-width 600
>  :best-height 800)
>
>
> The above works ok except that it allows the text to be
> edited by the user. Having :ENABLED NIL for the editor pane
> disables the editing but it also disables the scroll bar.
>
> I suppose I should really be using CAPI:DISPLAY-PANE. But
> when I try that I have problems:
>
>
> ;; Same as above, except use a CAPI:DISPLAY-PANE instead
> ;; of a CAPI:EDITOR-PANE
> (capi:contain
>  (make-instance 'capi:display-pane
>                 :text *multi-line-text*
>                 :horizontal-scroll t
>                 :vertical-scroll t)
>  :best-x 0
>  :best-y 0
>  :best-width 600
>  :best-height 800)
>
> ;; Try using :VISIBLE-MAX-HEIGHT for the CAPI:DISPLAY-PANE
> (capi:contain
>  (make-instance 'capi:display-pane
>                 :text *multi-line-text*
>                 :horizontal-scroll t
>                 :vertical-scroll t
>                 :visible-max-height 800)
>  :best-x 0
>  :best-y 0)
>
>
> In both case, the resulting window is too high to fit on the screen.
>
> Any ideas?
>
> BTW, similar things happen with very wide text, but that's not causing
> me any grief.
>
>
>


RE: Very tall CAPI:DISPLAY-PANEs and vertical scroll

> From: owner-lisp-hug@xanalys.com 
> [mailto:owner-lisp-hug@xanalys.com] On Behalf Of Sebastien
Saint-Sevin
> Sent: 28 September 2004 18:12
> To: ML Xanalys LispWorks; Simon Katz
> Subject: RE: Very tall CAPI:DISPLAY-PANEs and vertical scroll
> 
> Hi simon,
> 
> don't ask me why, but just add an :visible-min-height 
> constraint, and your
> display-pane should be ok.
> 
> (capi:contain
>  (make-instance 'capi:display-pane
>                 :text *multi-line-text*
>                 :horizontal-scroll t
>                 :vertical-scroll t
>                 :visible-max-height 800
> 		    :visible-min-height '(:character 5)))
> 
> Cheers,
> Sebastien.

Thanks, yes, that does the trick.



Re: Very tall CAPI:DISPLAY-PANEs and vertical scroll

Unable to parse email body. Email id is 2826

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