logo       

Re: Bug in CellRenderText?: msg#00323

Subject: Re: Bug in CellRenderText?
Matthias Bläsing said:
> ===snip===
> $renderer = Gtk2::CellRendererText->new;
> $column = Gtk2::TreeViewColumn->new_with_attributes ("Kommentar",
> $renderer, text => 4);
> print Dumper($renderer->get_property('attributes')); # Line 209
> $treeview->append_column ($column);
> ===snap===
>
> I get the following error:
>
> NULL pointer made it into gperl_new_boxed at ./gallery.pl line 209.
>
> It isn't perl'isch to do that ... ;-)

verified that this is true and that it's not his fault. there's a croak around
line 295 of GBoxed.xs.

changing the code to the following seems to straighten things out and provide
a correct behavior so far as i can tell:

        if (!boxed)
        {
#ifdef NOISY
                warn ("NULL pointer made it into gperl_new_boxed");
#endif
                return &PL_sv_undef;
        }

it's exercised any time you try to fetch a gobject's property (like
'attributes' on a CellRendererText) that is a  valid key, but has no value
set. (that's what seems to be the case where i'm testing it.)

the warning i silenced yesterday is now wrapped in #ifdef NOISY instead of #if
0. i would think that all of the warns in #ifdef NOISY's would be better off
as carp's so that they'd tell the user where the code that screwed things up
was even if it wasn't their fault, but that's just me and i could easily be
wrong. the message that was received here was from a croak so it did give the
perl line, and that probably made it a lot easier for matthias to locate the
offending code and send something out that would help to find the problem.

i'll commit the above change, if there's something wrong with it, it can
always be backed out or modified to be correct, i'm by no means an expert with
what is going on at the low levels of the Glib module.

-rm


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe