Lisp HUG Maillist Archive

How to keep row-layout adjustment when inside column-layout?

Hello,

It seems that when row-layout is contained in column-layout it loses
the adjustments. Does anybody know why?

There is sample code below.

(Using LispWorks Personal 5.02 Intel on OS X)

Best regards,

Mikko Ahonen

(defun make-row ()
       (make-instance
        'capi:row-layout
        :visible-min-width 300
        :adjust '(:left :right)
        :description
        (list
         (make-instance 'capi:title-pane :text "foo")
         (make-instance 'capi:option-pane :visible-max-width 100
:items '(1 2 3)))))

; this works as expected
(capi:contain (make-row))

; here adjustment  loses adjustment (and size?)
(capi:contain
 (make-instance
  'capi:column-layout
  :description (list (make-row))))


Re: How to keep row-layout adjustment when inside column-layout?

I'm not sure, but what it does doesn't violate any of the constraints 
you specified.  In both cases option-pane is 100 or less in width. So it 
looks like by itself the row-layout extends the last element to its 
maximum, but when used in a column-layout the row-layout sets the last 
element to its minimum.

Adding a nil element to the row-layout makes them both behave the same 
as does specifying a min width for option-pane.

(defun make-row ()
        (make-instance
         'capi:row-layout
         :visible-min-width 300
         :adjust '(:left :right)
         :description
         (list
          (make-instance 'capi:title-pane :text "foo")
          (make-instance 'capi:option-pane :visible-max-width 100
		:items '(1 2 3)) nil)))

OR

(defun make-row ()
        (make-instance
         'capi:row-layout
         :visible-min-width 300
         :adjust '(:left :right)
         :description
         (list
          (make-instance 'capi:title-pane :text "foo")
          (make-instance 'capi:option-pane :visible-min-width 100 
:visible-max-width t
:items '(1 2 3)))))


Mikko Ahonen wrote:
> Hello,
> 
> It seems that when row-layout is contained in column-layout it loses
> the adjustments. Does anybody know why?
> 
> There is sample code below.
> 
> (Using LispWorks Personal 5.02 Intel on OS X)
> 
> Best regards,
> 
> Mikko Ahonen
> 
> (defun make-row ()
>        (make-instance
>         'capi:row-layout
>         :visible-min-width 300
>         :adjust '(:left :right)
>         :description
>         (list
>          (make-instance 'capi:title-pane :text "foo")
>          (make-instance 'capi:option-pane :visible-max-width 100
> :items '(1 2 3)))))
> 
> ; this works as expected
> (capi:contain (make-row))
> 
> ; here adjustment  loses adjustment (and size?)
> (capi:contain
>  (make-instance
>   'capi:column-layout
>   :description (list (make-row))))
> 
> 


Re: How to keep row-layout adjustment when inside column-layout?

Hello,

Thanks for the switft reply.

My problem is actually not the size of the button (although the change
was also surprising) but that :adjust keyword parameter seems to
somehow get ignored, i.e. both fields are adjusted left.

It seems that at least on my platform both your examples for both of
my original calls to capi:contain ignore :adjust. With my original
version of make-row first one did not, but the second one did.

Best regards,

Mikko Ahonen

On Sun, Apr 20, 2008 at 11:54 PM, Mitch Berkson <mitch@bermita.com> wrote:
> I'm not sure, but what it does doesn't violate any of the constraints you
> specified.  In both cases option-pane is 100 or less in width. So it looks
> like by itself the row-layout extends the last element to its maximum, but
> when used in a column-layout the row-layout sets the last element to its
> minimum.
>
>  Adding a nil element to the row-layout makes them both behave the same as
> does specifying a min width for option-pane.
>
>
>  (defun make-row ()
>        (make-instance
>         'capi:row-layout
>         :visible-min-width 300
>         :adjust '(:left :right)
>         :description
>         (list
>          (make-instance 'capi:title-pane :text "foo")
>          (make-instance 'capi:option-pane :visible-max-width 100
>                 :items '(1 2 3)) nil)))
>
>  OR
>
>
>  (defun make-row ()
>        (make-instance
>         'capi:row-layout
>         :visible-min-width 300
>         :adjust '(:left :right)
>         :description
>         (list
>          (make-instance 'capi:title-pane :text "foo")
>          (make-instance 'capi:option-pane :visible-min-width 100
> :visible-max-width t
>  :items '(1 2 3)))))
>
>
>
>
>  Mikko Ahonen wrote:
>
> > Hello,
> >
> > It seems that when row-layout is contained in column-layout it loses
> > the adjustments. Does anybody know why?
> >
> > There is sample code below.
> >
> > (Using LispWorks Personal 5.02 Intel on OS X)
> >
> > Best regards,
> >
> > Mikko Ahonen
> >
> > (defun make-row ()
> >       (make-instance
> >        'capi:row-layout
> >        :visible-min-width 300
> >        :adjust '(:left :right)
> >        :description
> >        (list
> >         (make-instance 'capi:title-pane :text "foo")
> >         (make-instance 'capi:option-pane :visible-max-width 100
> > :items '(1 2 3)))))
> >
> > ; this works as expected
> > (capi:contain (make-row))
> >
> > ; here adjustment  loses adjustment (and size?)
> > (capi:contain
> >  (make-instance
> >  'capi:column-layout
> >  :description (list (make-row))))
> >
> >
> >
>


Re: How to keep row-layout adjustment when inside column-layout?

Hello Mikko,

| It seems that when row-layout is contained in column-layout it loses
| the adjustments. Does anybody know why?
| 
| There is sample code below.
| 
| (Using LispWorks Personal 5.02 Intel on OS X)
| 
| Best regards,
| 
| Mikko Ahonen
| 
| (defun make-row ()
|        (make-instance
|         'capi:row-layout
|         :visible-min-width 300
|         :adjust '(:left :right)
|         :description
|         (list
|          (make-instance 'capi:title-pane :text "foo")
|          (make-instance 'capi:option-pane :visible-max-width 100
| :items '(1 2 3)))))

As Mitch has noted, the :adjust initarg specifies vertical adjustment for
row-layout children. But it should be one of :top, :bottom, or :center, not
a list. All the children are adjusted the same.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Re: How to keep row-layout adjustment when inside column-layout?

Thanks for the help Dmitry and Mitch,

Seems like I mis-interpreted the documentation.

Best regards,

Mikko Ahonen

On Mon, Apr 21, 2008 at 8:40 AM, Dmitriy Ivanov <divanov@aha.ru> wrote:
> Hello Mikko,
>
>
>  | It seems that when row-layout is contained in column-layout it loses
>  | the adjustments. Does anybody know why?
>  |
>  | There is sample code below.
>  |
>  | (Using LispWorks Personal 5.02 Intel on OS X)
>  |
>  | Best regards,
>  |
>  | Mikko Ahonen
>  |
>  | (defun make-row ()
>  |        (make-instance
>  |         'capi:row-layout
>  |         :visible-min-width 300
>  |         :adjust '(:left :right)
>  |         :description
>  |         (list
>  |          (make-instance 'capi:title-pane :text "foo")
>  |          (make-instance 'capi:option-pane :visible-max-width 100
>  | :items '(1 2 3)))))
>
>  As Mitch has noted, the :adjust initarg specifies vertical adjustment for
>  row-layout children. But it should be one of :top, :bottom, or :center, not
>  a list. All the children are adjusted the same.
>  --
>  Sincerely,
>  Dmitriy Ivanov
>  lisp.ystok.ru
>


Re: How to keep row-layout adjustment when inside column-layout?

On Tue, 22 Apr 2008 18:03:53 +0300, "Mikko Ahonen" <mikko.ahonen@iki.fi> wrote:

> Seems like I mis-interpreted the documentation.

FWIW, I made the same mistake some time ago.  From the documentation,
one can conclude that :ADJUST should also accept a list, but for
ROW-LAYOUT and COLUMN-LAYOUT this makes no sense given how they work.
It is only meaningful for GRID-LAYOUT.

Edi.


Re: How to keep row-layout adjustment when inside column-layout?

Unable to parse email body. Email id is 8007

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