Lisp HUG Maillist Archive

vertical-scroll in capi:grid-layout

I'd like to have a grid-layout with a vertical scroll bar.  In the 
example below, when vertical-scroll is t, a space is visible for the 
vertical scroll bar even when it is not needed.  Also I am able to drag 
the window so that a region below the grid-layout is visible in the window.

Is there a way that:
1. I can eliminate the reserved space on the right when the vertical 
scroll bar is not displayed.
2. Limit the max height of the containing window to that of the grid-layout?

Thank you.

(capi:contain (make-instance
                'capi:grid-layout
                :vertical-scroll t  ; or nil
                :description '("Item 1" "Item 20000" "Item 30000"
                               "4" "5" "6"
                               "7" "8" "9"
                               "107" "108" "109"
                               "2001" "2008" "20019")
                :columns 3))


RE: vertical-scroll in capi:grid-layout

> -----Original Message-----
> From: owner-lisp-hug@lispworks.com 
> [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Mitch Berkson
> Sent: Monday, July 07, 2008 1:51 PM
> To: lisp-hug@lispworks.com
> Subject: vertical-scroll in capi:grid-layout
> 
> 
> 
> I'd like to have a grid-layout with a vertical scroll bar.  In the 
> example below, when vertical-scroll is t, a space is visible for the 
> vertical scroll bar even when it is not needed.  Also I am 
> able to drag 
> the window so that a region below the grid-layout is visible 
> in the window.
> 
> Is there a way that:
> 1. I can eliminate the reserved space on the right when the vertical 
> scroll bar is not displayed.
> 2. Limit the max height of the containing window to that of 
> the grid-layout?
> 
> Thank you.
> 
> (capi:contain (make-instance
>                 'capi:grid-layout
>                 :vertical-scroll t  ; or nil
>                 :description '("Item 1" "Item 20000" "Item 30000"
>                                "4" "5" "6"
>                                "7" "8" "9"
>                                "107" "108" "109"
>                                "2001" "2008" "20019")
>                 :columns 3))
> 

Hi Mitch,

I don't know if 1 can be achieved. I don't think so. 2. can certainly be achieved by placing the grid-layout into another one btw.
by using capi:define-interface. capi:contain is for testing purpose as far as I know. I would not use it in a program.

The following works:

(use-package :capi)

(define-interface test ()
  ()
  (:layouts
   (grid grid-layout '("Item 1" "Item 20000" "Item 30000"
                                "4" "5" "6"
                                "7" "8" "9"
                                "107" "108" "109"
                                "2001" "2008" "20019")
         :vertical-scroll t 
         :external-min-height '(character 5)
         :columns 3)))

(contain (make-instance 'test))


Andreas


Re: vertical-scroll in capi:grid-layout


I'd like to have a grid-layout with a vertical scroll bar.  In the 
example below, when vertical-scroll is t, a space is visible for the 
vertical scroll bar even when it is not needed.  Also I am 
able to drag 
the window so that a region below the grid-layout is visible 
in the window.

Is there a way that:
1. I can eliminate the reserved space on the right when the vertical 
scroll bar is not displayed.
2. Limit the max height of the containing window to that of 
the grid-layout?

Thank you.

(capi:contain (make-instance
                'capi:grid-layout
                :vertical-scroll t  ; or nil
                :description '("Item 1" "Item 20000" "Item 30000"
                               "4" "5" "6"
                               "7" "8" "9"
                               "107" "108" "109"
                               "2001" "2008" "20019")
                :columns 3))

    

Hi Mitch,

I don't know if 1 can be achieved. I don't think so. 2. can certainly be achieved by placing the grid-layout into another one btw.
by using capi:define-interface. capi:contain is for testing purpose as far as I know. I would not use it in a program.

The following works:

(use-package :capi)

(define-interface test ()
  ()
  (:layouts
   (grid grid-layout '("Item 1" "Item 20000" "Item 30000"
                                "4" "5" "6"
                                "7" "8" "9"
                                "107" "108" "109"
                                "2001" "2008" "20019")
         :vertical-scroll t 
         :external-min-height '(character 5)
         :columns 3)))

(contain (make-instance 'test))


Andreas
  
Andreas,

Thanks for looking at this. The appearance of the space for the scroll bar when it is not needed is unusual behavior for an interface - normally when the scroll bar is not needed, the main text area expands where the scroll bar was.  Maybe this should be considered a bug with grid-layout?

In your example, I am still able to resize the overall window to increase its height past the extent of the grid.  I have also tried placing the grid-layout in a simple-pinboard-layout, but that does not constrain the resizing either.

Mitch
Updated at: 2020-12-10 08:42 UTC