Re: Possible bug: gtk_tree_item_remove_subtree()
- From: <adustman comstar net>
- To: gtk-list redhat com, Pygtk mailing list <pygtk daa com au>
- Subject: Re: Possible bug: gtk_tree_item_remove_subtree()
- Date: Mon, 20 Apr 1998 17:29:49 -0400 (EDT)
Sorry for the cross-post, but it seems appropriate in this case. Followups
to the appropriate list.
On Mon, 20 Apr 1998 adustman@comstar.net wrote:
> On Mon, 20 Apr 1998 adustman@comstar.net wrote:
>
> > A quick inspection of gtktreeitem.c:1010-1016 reveals:
> >
> > if (item->pixmaps_box)
> > {
> > gtk_container_remove (GTK_CONTAINER (item->pixmaps_box),
> > item->minus_pix_widget);
> > gtk_container_add (GTK_CONTAINER (item->pixmaps_box),
> > item->plus_pix_widget);
> > }
>
> A similar code fragment is in gtk_real_tree_item_collapse() (910-916):
>
> if (tree_item->pixmaps_box)
> {
> gtk_container_remove (GTK_CONTAINER (tree_item->pixmaps_box),
> tree_item->minus_pix_widget);
> gtk_container_add (GTK_CONTAINER (tree_item->pixmaps_box),
> tree_item->plus_pix_widget);
> }
>
> Since the collapse occurs before remove_subtree would be called, this
> would indeed seem to be a bug and explains the error messages: It can't
> remove the mius_pix_widget because is is not a child of the pixmaps_box,
> and it can't add plus_pix_widget to pixmaps_box because it is already a
> child of pixmaps_box. So it would seem that the solution is to either a)
> remove lines 1010-1016 or b) change the gtk_container_remove to remove the
> child of item->pixmaps_box (i.e. don't specify a specific object, use
> gtk_container_children()). I lean towards a), but there may be other
> reasons to do b).
I commented out lines 1010-1016 (listed above), and this does indeed get
rid of the two warnings (not shown). However, it still dumps core. I did
manage to get a backtrace, though. Lines where there are no symbols are
deleted. The line number reference for gtktreeitem.c is almost certainly
wrong:
(gdb) exec-file /usr/local/bin/python
(gdb) run browse.py
Starting program: /usr/local/bin/python browse.py
[expanded tree, collapsed tree]
Program received signal SIGSEGV, Segmentation fault.
0x40172708 in gtk_tree_item_remove_subtree () at gtktreeitem.c:987
Source file is more recent than executable.
987 }
(gdb) bt
#0 0x40172708 in gtk_tree_item_remove_subtree () at gtktreeitem.c:987
#1 0x400f99ae in _wrap_gtk_tree_item_remove_subtree (self=0x0,
args=0x8107338)
at ./gtkmodule.c:14421
[Note: Since self=0x0, it looks like the sigfault is a problem in the
Python interface and not GTK itself.]
#15 0x400e43fb in PyGtk_SignalMarshal (object=0x80d6470, func=0x80c8dd8,
nparams=0, args=0xbffff270, arg_types=0x0, return_type=1)
at ./gtkmodule.c:993
#16 0x4015bfb4 in gtk_handlers_run (handlers=0x80cc838, info=0xbffff400,
after=0) at gtksignal.c:1358
#17 0x4015b9cb in gtk_signal_real_emit (object=0x80d6470, signal_type=69,
args=0xbffff450) at gtksignal.c:1080
#18 0x4015a7fd in gtk_signal_emit () at gtksignal.c:263
#19 0x4017135e in gtk_tree_item_collapse () at gtktreeitem.c:260
#20 0x40170d2e in gtk_tree_item_subtree_button_click (widget=0x81067e0)
at gtktreeitem.c:188
#21 0x4017bd29 in gtk_widget_marshal_signal_4 (object=0x81067e0,
func=0x40170c98 <gtk_tree_item_subtree_button_click>, func_data=0x0,
args=0xbffff4d8) at gtkwidget.c:3382
#22 0x4015bf8d in gtk_handlers_run (handlers=0x80cc800, info=0xbffff668,
after=0) at gtksignal.c:1352
#23 0x4015b9cb in gtk_signal_real_emit (object=0x81067e0, signal_type=19,
args=0xbffff6b8) at gtksignal.c:1080
#24 0x4015a7fd in gtk_signal_emit () at gtksignal.c:263
#25 0x4017a0f9 in gtk_widget_event () at gtkwidget.c:1621
#26 0x401407c4 in gtk_propagate_event (widget=0x81067e0, event=0x81dbf50)
at gtkmain.c:1663
#27 0x4013f4fa in gtk_main_iteration_do () at gtkmain.c:754
#28 0x4013f2a7 in gtk_main_iteration () at gtkmain.c:754
#29 0x4013f111 in gtk_main () at gtkmain.c:754
#30 0x400e725f in _wrap_gtk_main (self=0x0, args=0x8097f68)
at ./gtkmodule.c:2444
...
(gdb)
--
Andy Dustman Charles Babbage:
ComStar Communications Corp. He never used Linux,
(770) 333-8779 | PGP KeyID=0xC72F3F1D and now, he's dead.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]