Re: gnome-guile problem. Maybe?



-----BEGIN PGP SIGNED MESSAGE-----

On Sun, 2 Aug 1998, Michael J. Bedy wrote:

> To: gnome-list@gnome.org
> Subject: gnome-guile problem. Maybe?
> From: "Michael J. Bedy" <mjbedy@mtu.edu>
> 
> 
>   Hi,
> 
>   I've just desided to help the gnome project with what spare time I can
> scrape up, so I retrieved the source from the CVS archive. In order to get
> gnome-guile to compile, I had to do the following (see the patch). I just
> took a guess based on the comtents of the header file that
> gnome_canvas_new() was in.
> 
>   If I've done something incorrect here (the patch, the way I generated
> the patch, how I am submitting the patch, whatever) let me know, so I
> don't do it again :-) 

Well, perhaps one little thing ... please do a `diff oldfile newfile'
next time and not a `diff newfile oldfile' because it is a little bit
confusing when applying the patch otherwise.

> 
>   This is the first (open source) project I have contributed to, so any
> pointers would be appreciated. I don't know how much time I'll be able to
> provide (I'm starting grad school this fall) but I will try to devote some
> free time to the cause.
> 
>   Thanks,
>      - Mike
> 
> 
> *** guile-gnome/gnome-glue.c    Sun Aug  2 14:35:44 1998 
> --- guile-gnome/gnome-glue.c~   Sun Aug  2 14:26:36 1998
> ***************
> *** 1623,1636 ****
>       c_colormap = gdk_imlib_get_colormap();
>     else
>       c_colormap = (GdkColormap*)sgtk_scm2boxed (p_colormap);
> !   gtk_widget_push_visual(c_visual);
> !   gtk_widget_push_colormap(c_colormap);
> ! 
> !   cr_ret = gnome_canvas_new ();
> ! 
> !   gtk_widget_pop_visual();
> !   gtk_widget_pop_colormap();
> !   
>     SCM_ALLOW_INTS;
>   
>     return sgtk_wrap_gtkobj ((GtkObject*)cr_ret);
> --- 1623,1629 ----
>       c_colormap = gdk_imlib_get_colormap();
>     else
>       c_colormap = (GdkColormap*)sgtk_scm2boxed (p_colormap);
> !   cr_ret = gnome_canvas_new (c_visual, c_colormap);
>     SCM_ALLOW_INTS;
>   
>     return sgtk_wrap_gtkobj ((GtkObject*)cr_ret);
> 

Well, basically this is correct - yes, really. The only problem was
that the file you patched is automatically generated.

The other thing is that I thing that a function having zero arguments
in C should also have zero arguments in guile - and when you need to
do the gtk_widget_push_visual () etc. in C you should also need to do
this in guile. This will also make it easier to translate from one
language to the other.

So I removed the two arguments for the guile interface, too.

Here's the correct patch which I applied to CVS:

- --- ChangeLog   1998/07/25 18:47:34     1.19
+++ ChangeLog   1998/08/02 20:25:58     1.20
@@ -1,3 +1,9 @@
+1998-08-02  Martin Baulig  <martin@home-of-linux.org>
+
+       * gnome.defs: gnome_canvas_new() now takes zero arguments --
+       it will use the proper Gtk visual and colormap (settable by using
+       gtk_widget_push_visual() and gtk_widget_push_colormap()).
+
 1998-07-25  Marius Vollmer  <mvo@zagadka.ping.de>
 
        * gnomeg.c (gnome_canvas_item_newv): Remove "canvas" argument.
- --- gnome.defs  1998/07/17 09:46:10     1.16
+++ gnome.defs  1998/08/02 20:25:59     1.17
@@ -435,8 +435,7 @@
 
 (define-func gnome_canvas_new
   GtkWidget
- -  ((GdkVisual visual (= "gdk_imlib_get_visual()"))
- -   (GdkColormap colormap (= "gdk_imlib_get_colormap()"))))
+  ())
 
 (define-func gnome_canvas_root
   GnomeCanvasItem

If this breaks any application relying upon the two-argument
gnome_canvas_new () please let me know.

Martin

- -----------------------------------------------------------------
   Martin Baulig - Angewandte Mathematik - Universitaet Trier

   baulig@castor.uni-trier.de, http://www.home-of-linux.org/
   Key: 1024-bit key with ID C8178435 created 1997/01/24 
   ID:  67 C1 84 A0 47 F5 11 C5  5F 68 4C 84 99 05 C3 92
   Finger me for public key or fetch finger.txt from the url above
- ------------------------------------------------------------------


-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBNcTOAIA8K7jIF4Q1AQG68gQAmksB1sBGCs0da/5zkkjy661/qQAdIrTj
heT98t9nw3Y37VpLO9x6CVp32LImEzQC4D+IWFuB2NNxiRWDCdY+lMoge+ThfiLg
lgVJx5LVh8z3sgId9znnMOyR8fF2sxzs3/0VxVE5YPj1g9OgiHCXJIrZ6OnKCybu
ZFdgLKYH/20=
=0Bj6
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]