[cl-gtk2-devel] how to make non-resizable window?

Olof-Joachim Frahm Olof.Frahm at web.de
Sat Apr 17 18:57:39 UTC 2010


(Meh, that should've gone here in the first place.)

Hi Tamas,

Tamas Papp <tkpapp at gmail.com> writes:

> How can I make a window with a fixed size (ie non-resizable?)  If I
> add a :resizable nil

that's basically right, but since no widget is contained, the window will be
resized automatically to 0x0, so either use :width-request and
:height-request (or (setf (width-request ...))) or pack something into
the window.  For example:

> (defun foo (&optional (title "Title") (width 640) (height 480))
>   (within-main-loop
>     (let-ui (gtk-window 
> 	     :var window
> 	     :title title
> 	     :default-width width
> 	     :default-height height
> 	     :type :toplevel
> 	     :resizable nil
> 	     :width-request width
> 	     :height-request height)
>       (widget-show window))))

Cheers,
Olof




More information about the cl-gtk2-devel mailing list