CLIM mail archive


Re: Resizing Dialogs Query

>From: Scott McKay <>
>Date: Tue, 19 Jul 94 17:38:24 EDT
>Subject: Resizing Dialogs Query
>   Date:     Thu, 14 Jul 94 12:04:33 EDT
>   From: Nichael Cramer <ncramer@BBN.COM>
>   [...unsuccessful attempt to limit resizing of panes...]
>Try the following, which adds :MAX-WIDTH and :MAX-HEIGHT args to
>SIZE-FRAME-FROM-CONTENTS.  Be warned that Allegro CLIM might do
>something quite different with this kludgy function these days.
>(in-package :clim-internals)
>(defun size-frame-from-contents (stream 
>				  &key width height
>                                       max-width max-height
>				       (right-margin 10) (bottom-margin 10)
>				       (size-setter #'window-set-inside-size))
>  (declare (values width height))
>  (with-slots (output-record) stream
>    (with-bounding-rectangle* (left top right bottom) output-record
>      (let* ((graft (or (graft stream)
>			(find-graft)))		;--- is this right?
>	     (gw (bounding-rectangle-width (sheet-region graft)))
>	     (gh (bounding-rectangle-height (sheet-region graft)))
>	     ;;--- Does this need to account for the size of window decorations?
>             (max-width  (if max-width  (min gw max-width)  gw))
>             (max-height (if max-height (min gh max-height) gh))
>	     (width  (min max-width  (+ (or width (- right left)) right-margin)))
>	     (height (min max-height (+ (or height (- bottom top)) bottom-margin))))
>	;; The size-setter will typically resize the entire frame
>	(funcall size-setter stream width height)
>	(window-set-viewport-position stream left top)
>        (values width height)))))

Thanks, I'll try this but I'm not very optimistic.  I tried passing in my
own SIZE-SETTER function that did essentially this, but it didn't seem to
help.  In particular it seem to WINDOW-SET-INSIDE-SIZE itself that is the
ultimate culprit.


Main Index | Thread Index