Re: Tutorial code converted to Perl




Jason L Tibbitts III <tibbs@hpc.uh.edu> writes:

> That definitely bombs; I built out of CVS yesterday but I just updated and
> am building again.  Done, no change.  It seems (given my limited
> understanding) that shape_combine_mask is a Gtk::Gdk::Window method instead
> of a Gtk::Window method, leading to this error with the code you give:
> 
> Can't locate object method "shape_combine_mask" via package "Gtk::Window"
> at ./s7.5-2 line 151.
> 
> Attempting to override the package with something nasty like:
> 
> $window->Gtk::Gdk::Window::shape_combine_mask($mask, 0, 0);
> 
> gives the puzzling
> 
> variable is not of type Gtk::Gdk::Pixmap at ./s7.5-2 line 151.

Explaination:

 Gtk::Gdk::Window::shape_combine_mask  

(a wrapper for gdk_window_shape_combine_mask)

acts on GdkWindows, not GtkWindows. But GdkWindows, typologically
speaking, are just one of the subtypes of GdkDrawable. (Along
with GdkBitmap and GdkPixmap) The perl bindings I think lump them 
all together as GdkPixmap.

What you wanted is Gtk::Widget::shape_combine_mask. That doesn't
seem to be there, probably because it was confused with the
other shape_combine_mask.

Here's a untested patch to GtkWidget.xs to provide the necessary
function:

--- GtkWidget.xs.ots	Thu Apr 16 22:33:38 1998
+++ GtkWidget.xs	Thu Apr 16 22:33:46 1998
@@ -754,4 +754,11 @@
 	OUTPUT:
 	RETVAL
 
+void
+gtk_widget_shape_combine_mask (self, shape_mask, offset_x, offset_y)
+	Gtk::Widget	 self
+	Gtk::Gdk::Bitmap shape_mask
+	int	         offset_x
+	int	         offset_y
+
 #endif

Regards,
                                        Owen



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