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.
Ken
On 9/5/07, Ken Perry whistler@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.
Excellent that will fix it. I should probably do that to the edit box because I want to start it empty. I just couldn't find any examples in the demo's for sizing things.
Have you ever thought of adding the ability to size by character size? This of course would mean if the character set was changed it might change the size of the over all dialog but that is a good thing I would think?
Ken
On 9/5/07, Ken Perry kperry@blinksoft.com wrote:
Excellent that will fix it. I should probably do that to the edit box because I want to start it empty. I just couldn't find any examples in the demo's for sizing things.
Have you ever thought of adding the ability to size by character size? This of course would mean if the character set was changed it might change the size of the over all dialog but that is a good thing I would think?
That's an interesting thought, and although I can't remember specifically right now, it seems like I recall at least one other GUI framework that provides something like that. Would you mind adding an enhancement request to the SourceForge tracker? Thanks!
graphic-forms-devel@common-lisp.net