#3 Notebook "append_page_menu" isn't worked well

closed-fixed
Masao Mutoh
ruby-gnome (11)
5
2002-05-26
2002-03-24
HARUYAMA Seigo
No

The methods in Notebook class, append_page_menu,
append_page,
and the like, isn't worked well by Ruby/Gtk 0.27 and
current
(2002/3/24) CVS snapshot.

I use ruby 1.6.7 (2002-03-12) [i686-linux] and gtk-1.2.10.

When I do "ruby testgtk.rb" at
"ruby-gnome/gtk/sample/testgtk"
directory and select the notebook botton in testgtk's
window,
we get the following error message and testgtk.rb dies.
(In Ruby/Gtk 0.26, "testgtk.rb" works well)
#####
ruby-gnome-all-0.27/gtk/sample/testgtk% ruby testgtk.rb

Gtk-CRITICAL **: file gtkobject.c: line 1080
(gtk_object_get_data): assertion `GTK_IS_OBJECT
(object)' failed.

Gtk-WARNING **: invalid cast from `(unknown)' to
`GtkObject'
./notebook.rb:273:in `append_page_menu': not a Gtk
object (TypeError)
from ./notebook.rb:273:in `create_pages'
from ./notebook.rb:213:in `upto'
from ./notebook.rb:213:in `create_pages'
from ./notebook.rb:104:in `initialize'
from ./sample.rb:20:in `new'
from ./sample.rb:20:in `invoke'
from testgtk.rb:185:in `create_main_window'
from testgtk.rb:184:in `call'
from testgtk.rb:228:in `main'
from testgtk.rb:228:in `main'
from testgtk.rb:264

Discussion

  • HARUYAMA Seigo
    HARUYAMA Seigo
    2002-03-24

    • summary: Notebook append_page_menu isn't worked --> Notebook append_page_menu isn't worked well
     
  • HARUYAMA Seigo
    HARUYAMA Seigo
    2002-03-24

    • summary: Notebook append_page_menu isn't worked well --> Notebook "append_page_menu" isn't worked well
     
  • HARUYAMA Seigo
    HARUYAMA Seigo
    2002-03-24

    • summary: Notebook "append_page_menu" isn't worked well --> Notebook "append_page_menu" isn't worked well
     
  • Mike Wyer
    Mike Wyer
    2002-04-19

    Logged In: YES
    user_id=486179

    I get those errors whenever I connect any code to the
    'switch_page' signal of Notebook- the handler never
    executes, but the application dies. Without a handler
    connected to that signal, the Notebook works ok for me.

     
  • Logged In: YES
    user_id=207730

    I think the following patch fix the problem:

    --- rbgtkobject.c 2 Mar 2002 20:13:58 -0000 1.7
    +++ rbgtkobject.c 23 May 2002 10:15:51 -0000
    @@ -196,6 +196,13 @@ signal_setup_args(obj, sig, argc, params
    }
    if (signal_comp(signame, "set_focus", GTK_TYPE_WINDOW)) {
    rb_ary_push(args,
    get_value_from_gobject(GTK_VALUE_POINTER(params[0])));
    + return;
    + }
    + }
    + if (rb_obj_is_kind_of(obj, gNotebook)) {
    +
    if (signal_comp(signame, "switch_page", GTK_TYPE_NOTEBOOK)) {
    +
    rb_ary_push(args, make_notepage((GtkNotebookPage*)
    GTK_VALUE_OBJECT(params[0])));
    +
    rb_ary_push(args, INT2NUM(GTK_VALUE_INT(params[1])));
    return;
    }
    }
    i

     
  • Logged In: YES
    user_id=207730

    I think the following patch fix the problem:

    --- rbgtkobject.c 2 Mar 2002 20:13:58 -0000 1.7
    +++ rbgtkobject.c 23 May 2002 10:15:51 -0000
    @@ -196,6 +196,13 @@ signal_setup_args(obj, sig, argc, params
    }
    if (signal_comp(signame, "set_focus", GTK_TYPE_WINDOW)) {
    rb_ary_push(args,
    get_value_from_gobject(GTK_VALUE_POINTER(params[0])));
    + return;
    + }
    + }
    + if (rb_obj_is_kind_of(obj, gNotebook)) {
    +
    if (signal_comp(signame, "switch_page", GTK_TYPE_NOTEBOOK)) {
    +
    rb_ary_push(args, make_notepage((GtkNotebookPage*)
    GTK_VALUE_OBJECT(params[0])));
    +
    rb_ary_push(args, INT2NUM(GTK_VALUE_INT(params[1])));
    return;
    }
    }
    i

     
  • Masao Mutoh
    Masao Mutoh
    2002-05-26

    Logged In: YES
    user_id=495147

    This bug occured between src/rbgtkobject.c version 1.6 to 1.7.
    I restored correct 1.6 code to 1.8.

     
  • Masao Mutoh
    Masao Mutoh
    2002-05-26

    • assigned_to: klamath --> mutoh
    • summary: Notebook "append_page_menu" isn't worked well --> Notebook "append_page_menu" isn't worked well
    • status: open --> closed-fixed