Re: Glib::Object::Subclass bug? or Misunderstanding?




On Mar 18, 2006, at 10:01 AM, James Muir wrote:

Is this a bug, or am I as usual missing something?

It's functioning correctly; your SET_PROPERTY isn't actually doing anything. See below:


# Comment out the SET_PROPERTY and get() works!!
sub SET_PROPERTY
{
   my ($self, $pspec, $newval) = @_;

   my $param_name = $pspec->get_name;

   print "Item, SET_PROPERTY: name: $param_name value: $newval\n";

   # actually do something with $newval.  the default implementation
   # of GET_PROPERTY will look for the value in $self->{$param_name}.
   # the default implementation of SET_PROPERTY does this:
   $self->{$param_name} = $newval;

}


So, GET_PROPERTY was looking for $self->{border}, which was undefined, because no value had ever been set to it.


--
I believe that if music companies are going to set examples they need to do it to appropriate people and not dead people.
  --  Robin Chianumba




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