Lisp HUG Maillist Archive

Checkbox alignment

Hi,

I am trying (after several years) to create a simple GUI app in LW (Mac, 6.1). And, as usual, everything goes smoothly except for the CAPI. I find it difficult to use it in cases where I am not satisfied with the results it gives by default. Today, I spent too much time trying to figure out how to make checkboxes (and other elements) aligned vertically in a correct way. I tried to consult the CAPI documentation and Google without any success. It is interesting that even the examples in the LispWorks Examples directory make the buttons aligned incorrectly.

So, my question is the following. How can I improve this code to make the baselines of the texts aligned?

(capi:contain (make-instance 'capi:row-layout 
                             :description
                             (list (make-instance 'capi:display-pane :text "A text")
                                   (make-instance 'capi:check-button :text "A button"))))

Thanks,

Michal

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Checkbox alignment

Krupka Michal wrote on Thu, 22 Dec 2016 12:23:50 +0000 15:23:

| So, my question is the following. How can I improve this code to make
| the baselines of the texts aligned?
|
| (capi:contain (make-instance 'capi:row-layout
|                              :description
|                           (list (make-instance 'capi:display-pane :text
| "A text")
|                                 (make-instance 'capi:check-button :text
| "A button"))))

(capi:contain
 (make-instance 'capi:row-layout
  :description
  (list (make-instance 'capi:display-pane
         :title "A title" :text "A text"
         :title-position :left
         :title-adjust :bottom)
 (make-instance 'capi:check-button :text "A button"))
  :adjust :bottom))

Generally, there is no possibility to align the titles "A title" and "A
text" on baseline. So :adjust :center can look better.
--
Sincerely,
Dmitry Ivanov
lisp.ystok.ru

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Checkbox alignment

Hi,

Try adding :adjust :center to the row-layout’s initargs:

(capi:contain (make-instance 'capi:row-layout
                            :adjust :center
                            :description
                            (list (make-instance 'capi:display-pane :text "A text")
                                  (make-instance 'capi:check-button :text "A button"))))


Erik



> 22 dec. 2016 kl. 13:23 skrev Krupka Michal <michal.krupka@upol.cz>:
> 
> Hi,
> 
> I am trying (after several years) to create a simple GUI app in LW (Mac, 6.1). And, as usual, everything goes smoothly except for the CAPI. I find it difficult to use it in cases where I am not satisfied with the results it gives by default. Today, I spent too much time trying to figure out how to make checkboxes (and other elements) aligned vertically in a correct way. I tried to consult the CAPI documentation and Google without any success. It is interesting that even the examples in the LispWorks Examples directory make the buttons aligned incorrectly.
> 
> So, my question is the following. How can I improve this code to make the baselines of the texts aligned?
> 
> (capi:contain (make-instance 'capi:row-layout 
>                             :description
>                             (list (make-instance 'capi:display-pane :text "A text")
>                                   (make-instance 'capi:check-button :text "A button"))))
> 
> Thanks,
> 
> Michal
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: Checkbox alignment

Many thanks, this looks much better indeed. However, I can easily see that still the baselines are not exactly at the same height. Does it mean that row-layout cannot do this?

Michal

> 22. 12. 2016 v 20:09, Erik Ronström <erik.ronstrom@doremir.com>:
> 
> Hi,
> 
> Try adding :adjust :center to the row-layout’s initargs:
> 
> (capi:contain (make-instance 'capi:row-layout
>                            :adjust :center
>                            :description
>                            (list (make-instance 'capi:display-pane :text "A text")
>                                  (make-instance 'capi:check-button :text "A button"))))
> 
> 
> Erik
> 
> 
> 
>> 22 dec. 2016 kl. 13:23 skrev Krupka Michal <michal.krupka@upol.cz>:
>> 
>> Hi,
>> 
>> I am trying (after several years) to create a simple GUI app in LW (Mac, 6.1). And, as usual, everything goes smoothly except for the CAPI. I find it difficult to use it in cases where I am not satisfied with the results it gives by default. Today, I spent too much time trying to figure out how to make checkboxes (and other elements) aligned vertically in a correct way. I tried to consult the CAPI documentation and Google without any success. It is interesting that even the examples in the LispWorks Examples directory make the buttons aligned incorrectly.
>> 
>> So, my question is the following. How can I improve this code to make the baselines of the texts aligned?
>> 
>> (capi:contain (make-instance 'capi:row-layout 
>>                            :description
>>                            (list (make-instance 'capi:display-pane :text "A text")
>>                                  (make-instance 'capi:check-button :text "A button"))))
>> 
>> Thanks,
>> 
>> Michal
>> 
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> lisp-hug@lispworks.com
>> http://www.lispworks.com/support/lisp-hug.html
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

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