[graphic-forms-devel] Size of controls

Jack Unrue jdunrue at gmail.com
Thu Sep 6 05:05:11 UTC 2007


On 9/5/07, Ken Perry <whistler at blinksoft.com> wrote:
>
> I am using the flow controls to create a dialog.  The problem is I am
> dynamically adding strings to a list-box.  The problem is its staying the
> size of the first string I added.  I want to be able to set  the width of
> the list-box but I can't seem to get size or preferred size to work   does
> anyone have an example of a defined list-box with size set.

What you need to do is set the minimum size attribute of the control.
For example, if you add the following line to widget-tester.lisp immediately
after the make-instance call for lb1 in the populate-list-box-test-panel
function

    (setf (gfw:minimum-size lb1) (gfs:make-size :width 200 :height 150))

this results in the left-hand list box being at least 200 pixels wide. And
because of the way this test program is coded, the right-hand list box is
also made to be the same width.

Now, you'll notice that the list boxes are the same height as they were
before this change. That's because the other components of the panels
in the window are such that 150 pixels is less than the available vertical
space, so the list boxes end up taller than that.

-- 
Jack Unrue



More information about the Graphic-forms-devel mailing list