Still no menus or toolbars, but scrollbars are much more usable now. I've
also finished up the first cut at the generic function evaluation. A
sample snippet follows:
(defun gtk-import-function (retval name &rest args)
(let ((func nil)
(lisp-name (intern (replace-in-string name "_" "-")))
(doc-string nil))
(if (and (boundp lisp-name) (symbol-value lisp-name))
nil ; Already registered!
(setq doc-string (concat "The lisp version of " name))
(set lisp-name (gtk-import-function-internal retval name args))
(put lisp-name 'variable-documentation doc-string)
(eval `(defun ,lisp-name (&rest args)
,doc-string
(gtk-call-function ,lisp-name args))))))
(progn
(gtk-import-function 'GtkWidget "gtk_button_new_with_label"
'GtkString)
(gtk-import-function 'GtkButtonBoxStyle
"gtk_vbutton_box_get_layout_default")
(gtk-import-function 'GtkWindow "gtk_window_new" 'GtkWindowType)
(gtk-import-function nil "gtk_widget_show_all" 'GtkWidget))
If you evaluate that, you would then be able to do:
(let ((win (gtk-window-new GTK_WINDOW_TOPLEVEL)))
(put win 'title "This is a test window")
(gtk-widget-show-all win))
This pops up a window on the display. You can also use 'put' and 'get'
to
set arbitrary widget properties. They don't seem to update as quickly as
I'd like right now though - not sure why. But they _do_ work. :
I need to write a bunch of annoying tedious argument marshalling routines,
but the current code bitches and tells you exactly which one to define if
it can't find one. It builds up the marshalling function name while in
gtk-import-function-internal, based on the return value and argument types.
God I wish C had 'apply'. I'm going to check this code in later tonight.
I still plan on doing the generic interface, but after digging around the
GTK object model for most of a day and night it looks like there is a lot
of stuff you wouldn't be able to do via the get/set functions. The core
GTK widgets allow you to do most things, but there are some GNOME widgets
that don't define any (new) settable properties for themselves.
There is also a new function (dll-load "foo.so") that simply loads a
library into XEmacs' address space, for subsequent use by
gtk-import-function-internal. This will be used to load up the gnome
libraries, but avoid linking XEmacs directly to them.
Bow before the might of XEmacs... we kick ass. :) I'm getting too slaphappy
to work any more on this tonight. Andy - just wait until you have a 5 year
old puke all over your office floor at 2a in the morning. Now _thats_ fun
to clean up. :) 'Dad, I didn't know you worked this late... BLORRRRT'
-Bill P.