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



On 3 Mar 1998, Owen Taylor wrote:

> 
> <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--;

same effect as my original..

> 
> 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);
> )

again, it shifts the child by one pixel, but still causes a segfault when
i hit a "Close" button. there has to be something strange about these
buttons, i can use the window manager's close button with no problem. and
another strange thing, it only happens in the gtk_real_button_released
function. i can shift the child in every other function with no problem,
but once i try and do it when the button is released, i get weirdness.

> 
> I suspect you're corrupting memory elsewhere

that was my first thought, but it had no problem doing this on plain
0.99.3.
 
> 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.

unfortunately, i'm not experienced enough with C debuggers to do this. i
really appreciate your help, but i'm still quite lost as to how this
works...

 _        _  __     __             _ _                                  _
|        / |/ /_ __/ /_____         |       Nuke Skyjumper               |
|       /    / // /  '_/ -_)        |         "Master of the Farce"      |
|_     /_/|_/\_,_/_/\_\\__/        _|_           nuke@bayside.net       _|



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