From: Masao M. <mu...@hi...> - 2005-08-19 15:47:13
|
Hi, On Fri, 19 Aug 2005 17:24:06 +0200 (CEST) Jo...@bo... wrote: > Hi > > I have 2 problems to report. > The first one is that the procs sent to > Gtk::Treeveiw::Selection.set_select_function seems to be overwritten in > some cases if there are multiple treeviews. I cannot exactly point out > when, but it seems the storage of the procs is bogus in some way. There is > a workaround for this problem that goes like this: > > my_sel_func = proc {|bla bla bla| ... } > my_treeview.selection.set_select_function(&proc) > > It seems that when the procs are stored as local variables first, they are > not overwritten. Hmm, this may be a known GC problem. It'll fix Ruby-GNOME2-0.14.0 with GTK+-2.8.0. BTW, patch below may fix this problem, though I don't try it by myself. -------------- Index: rbgtktreeview.c =================================================================== RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gtk/src/rbgtktreeview.c,v retrieving revision 1.23 diff -u -r1.23 rbgtktreeview.c --- rbgtktreeview.c 29 Jan 2005 11:44:15 -0000 1.23 +++ rbgtktreeview.c 19 Aug 2005 15:40:27 -0000 @@ -45,7 +45,9 @@ treeview_get_selection(self) VALUE self; { - return GOBJ2RVAL(gtk_tree_view_get_selection(_SELF(self))); + VALUE selection = GOBJ2RVAL(gtk_tree_view_get_selection(_SELF(self))); + G_RELATIVE(self, selection); + return selection; } static VALUE -------------- > The other problem arises in an app that has a notebook and some treeviews > on different pages. I click aruond a bit in one of them, the contents > change as expected. Then I switch to another page and try to select an > item in the other view with attached selection function. I then get a > "[BUG] Segmentation fault" The views are created from a glade file, but > the rest (model, columns, renderer and selection callback proc) is created > in the script. I'm not very experienced with ruby / mixing, but I guess > since I get a segfault it is in the c code the problem is. The first thing > may be then how to connect gdb to my app so that I can see where the > segfault comes from. Could someone please help me doing that? $ gdb ruby $ run test.rb (segfault) $ bt (print stacktrace) > I cannot attach the source, since I'm developing this for a big company > and they wont let the source outside their system. No problem, But if you can give us reproduceable "simple" sample script, we'll be able to fix it soon. BTW, this ML is for Bugs tracker of SF. Please don't send your message here. If you want to ask us something, then join ruby-gnome2-devel-en ML. Or use the bug tracker system on SF. See below about our ML: http://sourceforge.net/mail/?group_id=53614 -- .:% Masao Mutoh<mu...@hi...> |