--iSJ1rrg8vv0i2qHPoW4
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Tue, 2001-09-11 at 14:06, Neil Conway wrote:
> I've been hacking on Ruby-GTK recently -- I'll take a look at
> implementing GtkPixmapMenuItem, it shouldn't be too difficult.

Okay, I've attached a (untested) patch which implements
GtkPixmapMenuItem. It compiles without warnings, but beyond that, I
haven't tested it at all.

It's in unified diff format; you'll need to apply it to Ruby-GNOME 0.25
and rebuild -- i.e. 

cd gnome-ruby-0.25
patch -p1 < ../pixmap-menuitem.patch
make distclean
ruby extconf.rb
make
make site-install

If you could tell me if this fixes the problem (or other feedback), I'd
appreciate it.

Cheers,

Neil

--iSJ1rrg8vv0i2qHPoW4
Content-Type: text/x-patch
Content-Disposition: attachment; filename=pixmap-menuitem.patch
Content-ID: <1000272514.316.5.camel / jiro>
Content-Transfer-Encoding: 7bit

diff -r -u -N gnome-ruby-0.25.orig/gnome/extconf.rb gnome-ruby-0.25/gnome/extconf.rb
--- gnome-ruby-0.25.orig/gnome/extconf.rb	Fri Sep 22 06:33:29 2000
+++ gnome-ruby-0.25/gnome/extconf.rb	Wed Sep 12 01:16:48 2001
@@ -68,6 +68,7 @@
     "rbgnome",
     "rbgtkdial",
     "rbgtk-clock",
+    "rbgtk-pixmap-menuitem",
     "rbgnome-about",
     "rbgnome-animator",
     "rbgnome-app",
@@ -113,6 +114,7 @@
 rbgnome#{obj_ext}: rbgnome.c rbgnome.h
 rbgtkdial#{obj_ext}: rbgtkdial.c rbgnome.h
 rbgtk-clock#{obj_ext}: rbgtk-clock.c rbgnome.h
+rbgtk-pixmap-menuitem#{obj_ext}: rbgtk-pixmap-menuitem.c rbgnome.h
 rbgnome-about#{obj_ext}: rbgnome-about.c rbgnome.h
 rbgnome-animator#{obj_ext}: rbgnome-animator.c rbgnome.h
 rbgnome-app#{obj_ext}: rbgnome-app.c rbgnome.h
diff -r -u -N gnome-ruby-0.25.orig/gnome/src/rbgnome.c gnome-ruby-0.25/gnome/src/rbgnome.c
--- gnome-ruby-0.25.orig/gnome/src/rbgnome.c	Wed Mar 29 13:43:11 2000
+++ gnome-ruby-0.25/gnome/src/rbgnome.c	Wed Sep 12 00:51:05 2001
@@ -86,6 +86,7 @@
 
     Init_gtk_dial();
     Init_gtk_clock();
+    Init_gtk_pixmap_menu_item();
 
     Init_gnome_animator();
     Init_gnome_app();
diff -r -u -N gnome-ruby-0.25.orig/gnome/src/rbgnome.h gnome-ruby-0.25/gnome/src/rbgnome.h
--- gnome-ruby-0.25.orig/gnome/src/rbgnome.h	Sat Jun  3 10:15:48 2000
+++ gnome-ruby-0.25/gnome/src/rbgnome.h	Wed Sep 12 00:52:11 2001
@@ -24,6 +24,7 @@
 
 extern VALUE gDial;
 extern VALUE gClock;
+extern VALUE gPixmapMenuItem;
 
 extern VALUE gnoAbout;
 extern VALUE gnoAnimator;
diff -r -u -N gnome-ruby-0.25.orig/gnome/src/rbgtk-pixmap-menuitem.c gnome-ruby-0.25/gnome/src/rbgtk-pixmap-menuitem.c
--- gnome-ruby-0.25.orig/gnome/src/rbgtk-pixmap-menuitem.c	Wed Dec 31 19:00:00 1969
+++ gnome-ruby-0.25/gnome/src/rbgtk-pixmap-menuitem.c	Wed Sep 12 01:17:48 2001
@@ -0,0 +1,37 @@
+#include "rbgnome.h"
+
+VALUE gPixmapMenuItem;
+
+static VALUE
+pmenuitem_initialize(self)
+    VALUE self;
+{
+    GtkWidget* pMenuItem;
+
+    pMenuItem  tk_pixmap_menu_item_new();
+    set_widget(self, pMenuItem);
+    return Qnil;
+}
+
+static VALUE
+pmenuitem_set_pixmap(self, pixmap)
+    VALUE self, pixmap;
+{
+    GtkPixmapMenuItem* pMenuItem;
+    GtkWidget* c_pixmap;
+
+    pMenuItem  TK_PIXMAP_MENU_ITEM(get_widget(self));
+    c_pixmap  et_widget(pixmap);
+    gtk_pixmap_menu_item_set_pixmap(pMenuItem, c_pixmap);
+    return Qnil;
+}
+
+void
+Init_gtk_pixmap_menu_item()
+{
+    gPixmapMenuItem  b_define_class_under(mGtk, "PixmapMenuItem", gMenuItem);
+    
+    rb_define_method(gPixmapMenuItem, "initialize", pmenuitem_initialize, 0);
+    rb_define_method(gPixmapMenuItem, "pixmap pmenuitem_set_pixmap, 1);
+    rb_define_alias(gPixmapMenuItem, "set_pixmap", "pixmap;
+}

--iSJ1rrg8vv0i2qHPoW4--