[PATCHES] Re: Gtk2::AboutDialog trouble




On Jan 21, 2005, at 7:03 PM, Jörn Reder wrote:

internal problem: GType GStrv (144925744) has not been registered with GPerl

wow. they slipped one by us in glib 2.4 -- G_TYPE_STRV, a boxed wrapper for string vectors. looks like nothing used it until now. :-/

i whipped up a quick patch that adds support for this type as a plain perl type -- that is,

     $about->set (authors => \ authors);
     @authors = @{ $about->get ('authors') };

work as you'd expect. As a bonus, it was easy to add a special case that any non-reference scalar would be interpreted as a single-element list, so that

     $about->set (authors => 'me');

should also work. Both undef and an empty array are interpreted as NULL (an empty string vector). Such magic may not be desirable; what does everybody think?


I checked Gtk2/xs/GtkAboutDialog.xs and indeed couldn't find any sv_utf8_upgrade() which seems to be necessary here. I'm no XS expert but nevertheless tried to add sv_utf8_upgrade() accordingly but I failed due to the SETTER macro I do not fully understand (which variable is the SV here?).

SETTER is just a way to collect the stack parsing code in one place; the SV it will be working on comes from ST(), the macro that gives you an element on the stack.

the easy fix, though, is to change SvPV_nolen to SvGChar. note that GETTER properly uses newSVGChar.


So this bug report unfortunetaly remains a simple bug report without any patch attached... ;)

no worries.  i needed a break from working overtime.  ;-)


Patches against HEAD for both Glib and Gtk2 attached. The Gtk2 patch requires the Glib patch so it can test the properties, but since we don't have a new version number until the next release, the version checks won't detect that for you.

Attachment: gstrv.patch
Description: Binary data

Attachment: about-dialog.patch
Description: Binary data




--
Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we.
  -- President George W. Bush


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