Lisp HUG Maillist Archive

Specifying layout width with a percentage value

Hi,

This might be trivial but I cannot find an example from the manual or the
example directory that does this.

I want to put elements in a row or column layout and specify the width using a
percentage value instead of an absolute pixel value. 

Basically it’s same as what you can do with html table.
I know there’s a grid layout, but it’s not as flexible as using combination of
column and row layouts.

Here’s what I want to do. When I maximize the window, the space between the
buttons will expand accordingly:

<-----------outer-width-800-pixels---------->
+-------------------------------------------+
|                 ratio 1:1                 |
|+-----------inner-width-100%--------------+|
||+---------+          |+---------+        ||
||| button1 |          || button2 |        ||
||+---------+          |+---------+        ||
||                     |                   ||
|+-----------------------------------------+|
+-------------------------------------------+


This is what I have now:

<-----------outer-width-800-pixels---------->
+-------------------------------------------+
|         ratio 1:1                         |
|+-----------inner-width-800-pixels--------+|
||+---------+|+---------+                  ||
||| button1 ||| button2 |                  ||
||+---------+|+---------+                  ||
|+-----------------------------------------+|
+-------------------------------------------+

Thanks in advance,
-- Mac




Re: Specifying layout width with a percentage value

Maybe I misundertsand, but don't you just want

:ratios '(1 1)

?

pt


Re: Specifying layout width with a percentage value

On 3/14/06, Paul Tarvydas <tarvydas@allstream.net> wrote:
> Maybe I misundertsand, but don't you just want
>
> :ratios '(1 1)
>
> ?

OK. I'm not sure if this make it clearer.

This is in html what I'm trying to do with capi:

<table width=800>
  <tr><td>
  <table width=100%>
    <tr>
      <td width=50%><input type=submit></td>
      <td width=50%><input type=submit></td>
    </tr>
  </table>
  </td></tr>
</table>


This is what I have in capi. The two buttons are cramped on the left
side of the layout, instead of space out across the window.:

<table width=800>
  <tr><td>
  <table>
    <tr>
      <td width=50%><input type=submit></td>
      <td width=50%><input type=submit></td>
    </tr>
  </table>
  </td></tr>
</table>

(capi:define-interface interface-1 ()
  ()
  (:panes
   (push-button-2
    capi:push-button
    :text "Push-Button-2")
   (push-button-3
    capi:push-button
    :text "Push-Button-3"))
  (:layouts
   (column-layout-1
    capi:column-layout
    '(row-layout-1)
    :external-min-width 800
    :visible-min-width 800
    :width 800)
   (row-layout-1
    capi:row-layout
    '(push-button-2 push-button-3)
    :ratios '(1 1)))
  (:default-initargs
   :layout 'column-layout-1
   :title "Interface-1"))


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