On 9/1/05, Alejandro Forero Cuervo <[EMAIL PROTECTED]> wrote:
> 
> We have updated the eggs and added more information to the wiki.  The
> eggs published were created against gtk+ 2.6.9 (for different gtk+
> releases one would probably want to go through the whole process of
> regenerating the eggs from the swig interface files).

Very good. I have attached a patch with a few other things:

- I think it would be the best to include the .i files into the egg and
  run swig, if available from the setup script. The chances that a user
  has a different gtk version is high
- I also commented out the inclusion of gtkexpander.h - we probably
  should check the gtk version, here...
- The dialog-boxes examples should work slightly better now

Anyway, great work! I'm looking forward to some serious gtk
programming. Being pretty annoyed recently with Qt 4 will make
this even more delightful.


cheers,
felix
Index: samples/dialog-boxes.scm
===================================================================
--- samples/dialog-boxes.scm	(revision 3944)
+++ samples/dialog-boxes.scm	(working copy)
@@ -22,13 +22,13 @@
 
 (define (gtk-dialog-new-with-buttons! title parent flags buttons)
   (let ((dialog (gtk-dialog-new)))
-         (gtk-window-set-title dialog title)
-         (gtk-window-set-transient-for parent)
-         (for-each
-           (lambda (button)
-             (gtk-dialog-add-button (car (button)) (car (cdr (button)))))
-           buttons)
-         (dialog)))
+    (gtk-window-set-title dialog title)
+    (gtk-window-set-transient-for dialog parent)
+    (for-each
+     (lambda (button)
+       (gtk-dialog-add-button dialog (car button) (car (cdr button))))
+     buttons)
+    dialog))
          
 
 (define (message-dialog-clicked)
@@ -37,11 +37,10 @@
                  (GTK-DIALOG-MODAL)
                  (GTK-MESSAGE-INFO)
                  (GTK-BUTTONS-OK)
-                 "This message box has been popped up the following\n"
-                 "number of times:")))
+                 "This message box has been popped up the following\nnumber of times:")))
     
     
-    (gtk-message-dialog-format-secondary-text dialog "%d" *i*)
+    (gtk-message-dialog-format-secondary-text dialog (->string *i*))
     (gtk-dialog-run dialog)
     (gtk-widget-destroy dialog)
     (set! *i* (+ *i* 1))))
Index: gtk.setup
===================================================================
--- gtk.setup	(revision 3944)
+++ gtk.setup	(working copy)
@@ -1,2 +1,7 @@
+(when (zero? (system "swig -version"))
+  (print "SWIG is available, regenerating wrappers...")
+  (run (swig -chicken -nounit "`pkg-config gtk+-2.0 --cflags-only-I`" gtk.i)) )
+
 (run (csc -s -O2 -d0 gtk.scm gtk_wrap.c "-C \"`pkg-config --cflags gtk+-2.0`\"" "-L \"`pkg-config --libs gtk+-2.0`\"" ))
-(install-extension 'gtk '("gtk.so"))
+(install-extension 'gtk '("gtk.so") '((version 0.1)))
+
Index: glib.setup
===================================================================
--- glib.setup	(revision 3944)
+++ glib.setup	(working copy)
@@ -1,2 +1,7 @@
+(when (zero? (system "swig -version"))
+  (print "SWIG is available, regenerating wrappers...")
+  (run (swig -chicken -nounit "`pkg-config glib-2.0 --cflags-only-I`" glib.i)) )
+
 (run (csc -s -O2 -d0 glib.scm glib_wrap.c "-C \"`pkg-config --cflags glib-2.0`\"" "-L \"`pkg-config --libs glib-2.0`\"" ))
-(install-extension 'glib '("glib.so"))
+(install-extension 'glib '("glib.so") '((version 0.1)))
+
Index: gtk.i
===================================================================
--- gtk.i	(revision 3944)
+++ gtk.i	(working copy)
@@ -133,8 +133,11 @@
 %ignore gtk_main;
 
 %insert(chicken) %{
-(define gtk-main
-  (foreign-safe-lambda* void () "gtk_main();"))
+#>!
+extern void gtk_main();
+___declare(rename, "gtk_main;gtk-main")
+___safe void gtk_main();
+<#
 %}
 
 /* Actually include all the GTK+ files.  We're still missing many, please add
@@ -152,7 +155,7 @@
 %include "gtk/gtkdialog.h"
 %include "gtk/gtkentry.h"
 %include "gtk/gtkenums.h"
-%include "gtk/gtkexpander.h"
+//%include "gtk/gtkexpander.h"
 %include "gtk/gtkframe.h"
 %include "gtk/gtkhbbox.h"
 %include "gtk/gtkhbox.h"
Index: Makefile
===================================================================
--- Makefile	(revision 3944)
+++ Makefile	(working copy)
@@ -12,12 +12,12 @@
 glib.so: glib.scm glib_wrap.c
 	csc -s -O2 -d0 glib.scm glib_wrap.c  -C "`pkg-config --cflags glib-2.0`" -L "`pkg-config --libs glib-2.0`" 2>&1
 
-.PHOHNY: release release-glib release-gtk
+.PHONY: release release-glib release-gtk
 release: release-glib release-gtk
 
 release-glib: glib.scm
 	mkdir egg-dir && \
-	cp glib.scm glib_wrap.c glib.setup egg-dir && \
+	cp glib.scm glib_wrap.c glib.setup egg-dir glib.i && \
 	cp README-egg egg-dir/README && \
 	cd egg-dir && \
 	tar cvfz ../glib.egg * && \
@@ -26,7 +26,7 @@
 
 release-gtk: gtk.scm
 	mkdir egg-dir && \
-	cp gtk.scm gtk_wrap.c gtk.setup egg-dir && \
+	cp gtk.scm gtk_wrap.c gtk.setup egg-dir gtk.i && \
 	cp README-egg egg-dir/README && \
 	cd egg-dir && \
 	tar cvfz ../gtk.egg * && \
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to