Re: Strange bug while subclassing Gtk2::Box




On Nov 1, 2005, at 2:21 PM, Jaap Karssenberg wrote:

To cut a long story short with gtk+ < 2.8.x we need the chaining up in order to set the "allocation" attribute of the box object.
...
B.t.w is there a way to set such attributes (that are not properties) of gtk objects from perl?

Good find. I added these lines to the end of your do_size_allocate() and it started working fine on both the old and new gtk+:

    $self->allocation->x ($allocation->x);
    $self->allocation->y ($allocation->y);
    $self->allocation->width ($allocation->width);
    $self->allocation->height ($allocation->height);

There's a comment in GtkWidget.xs that says "return the allocation as a read-only rectangle", but i think that goes back a very long way to the days before GdkRectangle had mutators.


I always thought that the size-allocate signal was supposed to be emitted from a wrapper that applied the changed allocation after all the signal handlers had a go a modifying it, but apparently that's not true.


--
To me, "hajime" means "the man standing opposite you is about to hit you with a stick".
  -- Ian Malpass, speaking of the Japanese word for "the beginning"




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