[lambda-gtk-devel] some newbie question

Sergei Klimov serjkl at gmail.com
Mon Aug 18 22:31:47 UTC 2008


Hi, i was wondering if someone can, please, help me with one of the
function of lambda-gtk or, even better, with better understanding of
lambda-gtk?

I am new to this this list, so i am sorry if my question is out of line.
I am also pretty new to the whole lisp and gtk thing.

i am trying to restrict the user ability to resize the main window,
more precisely i want the window to keep constant ratio. From the GTK
manual i think it is possible to achieve this by:

void                gdk_window_set_geometry_hints       (GdkWindow *window,
                                                         GdkGeometry *geometry,

GdkWindowHints geom_mask);

Maybe this should be a function which starts with gtk_ . The function
is there, but i have no idea how to pass two additional parameters to
the function, geometry and geom_mask. I've found the following
definition:

(defalien-type GdkGeometry
 (struct _GdkGeometry (min_width gint) (min_height gint) (max_width gint)
  (max_height gint) (base_width gint) (base_height gint) (width_inc gint)
  (height_inc gint) (min_aspect gdouble) (max_aspect gdouble)
  (win_gravity GdkGravity)))

but this not in the export list, i think.

the only relevant functions i could find are the function like this one:

(defun gdk::Geometry.min-width (ptr &optional (val nil vp))
....
    (if vp (setf (slot v587 'min_width) val) (slot v587 'min_width))))

which i think are used to access the specific fields of the geometry structure.
How can create this structure? How do I create any alien variable?
Again, i am a newbie. i am sure the answer is trivial, but could not
figure this one out. Can you at least point me in the right direction?
Or even better toss me some example code?

If this is relevant: i run linux, debian, sbcl and lambda-gtk from asdf-install.

Thanks in advance.

Sergei



More information about the Lambda-gtk-devel mailing list