[gtk2-perl-xs] Gtk2::Style::font_desc



Hi there. Gtk2::Style::font_desc seems broken currently. I'm pretty
new to both GTK2 and XS, but the following patch seems to help:

--- Gtk2-0.22/xs/GtkStyle.xs    2003-06-16 01:55:08.000000000 +0100
+++ Gtk2-0.22/xs/GtkStyle.xs    2003-05-22 15:23:24.000000000 +0100
@@ -48,7 +48,7 @@
            /* FIXME: is it correct to _copy these */
            case 1: RETVAL = newSVGdkColor_copy (&(style->black)); break;
            case 2: RETVAL = newSVGdkColor_copy (&(style->white)); break;
-           case 3: RETVAL = newSVPangoFontDescription_copy (style->font_desc); break;
+           case 3: RETVAL = newSVPangoFontDescription_copy (&(style->font_desc)); break;
            case 4: RETVAL = newSViv (style->xthickness); break;
            case 5: RETVAL = newSViv (style->ythickness); break;
            case 6: RETVAL = newSVGdkGC (style->black_gc); break;

Test program:
#!/usr/bin/perl -wl
use strict;
use Gtk2;

Gtk2->init;

my $window=new Gtk2::Window 'toplevel';
my $entry=new Gtk2::Entry;
$window->add($entry);
$window->show_all;
my $desc=$entry->style->font_desc;
print $desc->to_string;

I've not tested any of the other fields.

Nice work so far, btw. :)

Tom.



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