[graphic-forms-devel] Layout workings?

Ken Perry whistler at blinksoft.com
Sun Sep 9 16:01:15 UTC 2007



First I realize this is in alpha so if the answer is the layout mangier is
not working fully that is fine.  I just want to know how this is supposed to
work.

I have created a top level layout mangier that is vertical. inside it I have
put a layout mangier that is horizontal and has an label and edit box and
separately inside the top level under the first one I have put in a list
box.  Then finally I put another horizontal layout mangier under the list
box that has 3 buttons.

So I think what I should get is a row with label and edit box and a second
row with the list box and a third row with 3 buttons.  If I understand it
correctly it should grow the list box to be as long as my edit box and label
together.  Then finally make the buttons at the bottom all the same length
of the longest row.

If that is how it is supposed to work it is not.  My list box is not the
same length as the edit box let alone the edit box and label together.

  Can you take a look at this and tell me what I should be doing to line
these controls up in this dialog?

(defclass fruit-events (gfw:event-dispatcher) ())

(defmethod gfw:event-close ((disp fruit-events) (dlg gfw:dialog))
(call-next-method)
(let ((ownerp (gfw:owner dlg)))
(gfs:dispose dlg)
(unless ownerp
(gfw:shutdown 0))))
		
(defun fruit-basket ()
(gfw:startup "Fruit basket" (lambda ()
 (let* ((dlg (make-instance 'gfw:dialog :owner nil
:dispatcher (make-instance 'fruit-events)
:layout (make-instance 'gfw:flow-layout
:margins 8
:spacing 8
:style '(:vertical))
:style :modeless
:text "Fruit basket LISP demonstration"))
;  (edit-disp (make-instance 'edit-control-events))
(top-panel (make-instance 'gfw:panel
:layout (make-instance 'gfw:flow-layout
:spacing 4
:style '(:vertical))
:parent dlg))
(inner-panel (make-instance 'gfw:panel
:layout (make-instance 'gfw:flow-layout
:spacing 4)
:parent top-panel))
(fruit-list (make-instance 'gfw:list-box
;:callback (fruit-list-callback)
:parent top-panel))
(fruit-label (make-instance 'gfw:label
:text "Enter fruit:"
:parent inner-panel))
(fruit-edit (make-instance 'gfw:edit
:text 		"1234567890123456789012345"
:parent inner-panel))
(btn-panel (make-instance 'gfw:panel
:layout (make-instance 'gfw:flow-layout
:spacing 4)
:parent top-panel
))
(btn-add (make-instance 'gfw:button
:callback (lambda (disp btn )
(declare (ignore disp btn))
(gfw:append-item fruit-list (gfw:text fruit-edit ) nil nil)        	
(setf (gfw:text  fruit-edit) "")                    	
(gfw:give-focus fruit-edit))                           	
:style '(:default-button)
:text "Add"
:parent btn-panel))
(btn-remove (make-instance 'gfw:button
:callback (lambda (disp btn)
(declare (ignore disp btn))
(gfw:delete-selection  fruit-list)
(gfw:give-focus fruit-edit))
:style '(:default-button)
:text "Remove"
:parent btn-panel))
(btn-exit (make-instance 'gfw:button
:callback (lambda (disp btn)
(declare (ignore disp btn))
(let ((ownerp (gfw:owner dlg)))
(gfs:dispose dlg)
(unless ownerp
(gfw:shutdown 0))))
:style '(:cancel-button)
:text "Exit"
:parent btn-panel)))


	(declare (ignore fruit-label btn-add btn-remove btn-exit))
(gfw:pack dlg)
	    (setf (gfw:minimum-size dlg) (gfs:make-size :width 300 :height
200 ))
(setf (gfw:text fruit-edit) "")
(gfw:show dlg t)
dlg))))




More information about the Graphic-forms-devel mailing list