public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* examples/tictactoe.scm
@ 2003-05-25 23:33 Kevin Ryde
  2003-06-14 23:10 ` examples/tictactoe.scm Kevin Ryde
  2003-06-14 23:42 ` examples/tictactoe.scm Kevin Ryde
  0 siblings, 2 replies; 10+ messages in thread
From: Kevin Ryde @ 2003-05-25 23:33 UTC (permalink / raw)
  To: guile-gtk

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

I tried to run examples/tictactoe.scm and noticed gtk-class-new and
gtk-signal-new-generic seem to have bit-rotted slightly.

        * guile-gtk.c (gtk_class_new): Use gtk_type_query rather than
        gtk_type_get_info.
        (gtk_signal_new_generic): Use sgtk_callback_marshal for marshalling.

Not sure if this is actually right, but it takes it from not working
to seeming to work. :)

I see the gtk changelog says gtk_type_get_info got reverted.  I guess
gtk_type_query is the way to go, for gtk 1.2 at least.  Unless anyone
knows better I'd think it could be used unconditionally, no need for
an autoconf check by now.


[-- Attachment #2: guile-gtk.c.tictactoe.diff --]
[-- Type: text/plain, Size: 1174 bytes --]

--- guile-gtk.c.~1.15.~	2003-05-24 10:02:45.000000000 +1000
+++ guile-gtk.c	2003-05-25 12:15:41.000000000 +1000
@@ -2565,19 +2565,21 @@
 gtk_class_new (GtkType parent_type, gchar *name)
 {
   GtkTypeInfo info = { 0 };
-  GtkTypeInfo parent_info;
+  GtkTypeQuery *parent_query;
 
-  if (!gtk_type_get_info (parent_type, &parent_info))
+  parent_query = gtk_type_query (parent_type);
+  if (parent_query == NULL)
     return GTK_TYPE_INVALID;
 
   info.type_name = name;
-  info.object_size = parent_info.object_size;
-  info.class_size = parent_info.class_size;
+  info.object_size = parent_query->object_size;
+  info.class_size = parent_query->class_size;
   info.class_init_func = NULL;
   info.object_init_func = NULL;
 #if GTK_MAJOR_VERSION > 1 || GTK_MINOR_VERSION > 0
   info.base_class_init_func = NULL;
 #endif
+  g_free (parent_query);
 
   return gtk_type_unique (parent_type, &info);
 }
@@ -2596,7 +2598,7 @@
     return 0;
 
   signal_id = gtk_signal_newv (name, signal_flags, type,
-			       0, NULL,
+			       0, sgtk_callback_marshal,
 			       return_type, nparams, params);
   if (signal_id > 0)
     gtk_object_class_add_signals (gtk_type_class (type),

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-06-24 10:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-25 23:33 examples/tictactoe.scm Kevin Ryde
2003-06-14 23:10 ` examples/tictactoe.scm Kevin Ryde
2003-06-15  3:02   ` examples/tictactoe.scm Marius Vollmer
2003-06-19  0:55     ` examples/tictactoe.scm Kevin Ryde
2003-06-19 11:05       ` examples/tictactoe.scm Marius Vollmer
2003-06-23 14:24     ` examples/tictactoe.scm Andy Wingo
2003-06-23 22:16       ` examples/tictactoe.scm Marius Vollmer
2003-06-24 10:28         ` examples/tictactoe.scm Andreas Rottmann
2003-06-14 23:42 ` examples/tictactoe.scm Kevin Ryde
2003-06-19  0:55   ` examples/tictactoe.scm Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).