Re: .99.4 broke GTK_TOGGLE_BUTTON(button)->active (PLEASE READ)




<nuke@bayside.net> writes:

> On Tue, 3 Mar 1998, Tom Bech wrote:
> 
> > 
> > [snip]
> > >
> > >  GTK_WIDGET(GTK_LABEL(GTK_BUTTON(button)->child))->allocation.x--;
> > >  GTK_WIDGET(GTK_LABEL(GTK_BUTTON(button)->child))->allocation.y--;
> > >
> > 
> > Hm. You are aware that a button can have children that may not be
> > labels? Not that it matters in this case, - but why the typecast to
> > a label in the snippet above?
> 
> well, is there a better way to do that? i'm only trying to get the effect
> of having the button contents pressed. i'm very open to ideas if anyone
> knows how i *should* do it :)

What Tom was saying was that there is no obvious reason why that
shouldn't be:

   GTK_BUTTON(button)->child->allocation.x--;
   GTK_BUTTON(button)->child->allocation.y--;

I'm pretty sure neither one is causing delayed segfaults, though
the technique won't work if the widget actually has embedded
windows. (In that case, you'll should do:

   GtkAllocation child_allocation = *child->allocation;
   child_allocation.x--;
   child_allocation.y--;
   gtk_widget_allocation (child, &child_allocation);
)

I suspect you're corrupting memory elsewhere.

But basically, once you modify GTK, you're on your own. If you
present something that compiles with stock GTK and exhibits
the problem, then we could take a look at it. Otherwise, you'll
just have to become better friends with gdb.

Regards,
                                        Owen



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