Re: [gtk-list] Re: closing dialog in Gtk--




On 6 Mar 1998, Tero Pulkkinen wrote:
> 
> I think there's some problem with that format of connect(), I've got one
> bug report about it that it messes up the value passed, but I had
> no time to look into it yet :( Print the value of gd inside callback to be
> sure. If it looks bad, then its the same bug. (it does crash at gd->hide()
> call, doesnt it? -- again couldnt test that coz no X here :( )
>

You're right, gd seems to have a different value in main() than it does in
the callback. Here's where the crash happens:

#0  0x400871d6 in gtk_signal_emit_by_name ()
#1  0x804aef2 in Signal_proxy0<void, Gtk_Widget>::operator()
(this=0x80581b4)
    at /usr/local/include/gtk--sig.h:1035
#2  0x804ace4 in close_callback (gd=0x8058190) at CloseDialog.cc:6
#3  0x40087c3d in gtk_signal_default_marshaller ()
#4  0x40088784 in gtk_signal_set_funcs ()
#5  0x4008812c in gtk_signal_set_funcs ()
#6  0x40087159 in gtk_signal_emit ()
#7  0x4004ace0 in gtk_button_clicked ()
#8  0x4004c369 in gtk_button_leave ()
#9  0x401a8f07 in Gtk_Button::released_impl (this=0x8057f48) at
gtk--.h:2236
#10 0x401b586d in Gtk_Button::released_callback (o=0x8058190) at
gtk--.h:2241
#11 0x40087c3d in gtk_signal_default_marshaller ()
#12 0x400880c8 in gtk_signal_set_funcs ()
#13 0x40087159 in gtk_signal_emit ()
#14 0x4004acb0 in gtk_button_released ()
#15 0x4004bc52 in gtk_button_leave ()
#16 0x401a2bce in Gtk_Widget::button_release_event_impl (this=0x8057f48, 
    p1=0x805ff98) at gtk--.h:706
#17 0x401a2b7b in Gtk_Widget::button_release_event_callback (o=0x8058190, 
    p1=0x805ff98) at gtk--.h:711
#18 0x400a41a9 in gtk_widget_get_default_style ()
#19 0x40088164 in gtk_signal_set_funcs ()
#20 0x40087159 in gtk_signal_emit ()
#21 0x400a28ba in gtk_widget_event ()
#22 0x4006eb2a in gtk_get_event_widget ()
#23 0x4006dc84 in gtk_main_iteration_do ()
#24 0x4006d9d7 in gtk_main_iteration ()
#25 0x4006d8f9 in gtk_main ()
#26 0x401a0a81 in Gtk_Main::run (this=0xbffffc0c) at gtk--.h:3518
#27 0x804adf7 in main (argc=1, argv=0xbffffc40) at CloseDialog.cc:26

In frame 27, 
gd = (Gtk_Dialog *) 0x8052100
and as you can see the callback got 0x8058190.

I'm using egcs-1.0.1, that might matter.

> Also, the close_callback should always be &close_callback in connect()
> I think. Some compilers might not like giving a reference to a
> function in that... maybe it even matches the function-object template
> to that and not the function ptr one? :) 

Using &close_callback didn't seem to help with this particular problem,
but I will use it in the future...

> (hmm, gotta see if the
> last bug report about this has the same problem...yuup, exactly
> same situation... I think I know where to find the problem ;)
> 

Excellent. (I sure don't. :)

Thanks for the help, I guess I'll just move on to other parts of the
program and try again when a new Gtk-- come out. If you need any more info
from me just ask.

Thanks,
 Havoc Pennington






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