Gtk-CRITICAL **: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed



hi,

I am looking for some tips of how to get the culprit for the above mentioned warning. I have a notebook with 5 pages. On the first tab I have a gnome-canvas with some items on. For that I have registered an event handler to move objects on the canvas. The moving part works fine. When I press a key I get the assertion. Still eveything works. Of course I'd like to fix it anyway. So I run the app as
  G_DEBUG="fatal_warnings" gdb ~/buzztard/bin/bt-edit
and dump a backtrace:
[Switching to Thread -1225189712 (LWP 20028)]
0xb748509b in g_logv (log_domain=<value optimized out>, log_level=G_LOG_LEVEL_CRITICAL, format=0xb74ccb67 "%s: assertion `%s' failed",
    args1=0xbf93f4bc "]\207???k?? m??\002") at gmessages.c:493
493                     G_BREAKPOINT ();
(gdb) bt
#0 0xb748509b in g_logv (log_domain=<value optimized out>, log_level=G_LOG_LEVEL_CRITICAL, format=0xb74ccb67 "%s: assertion `%s' failed",
    args1=0xbf93f4bc "]\207???k?? m??\002") at gmessages.c:493
#1 0xb7485325 in g_log (log_domain=0xb7ac6ba7 "Gtk", log_level=G_LOG_LEVEL_CRITICAL, format=0xb74ccb67 "%s: assertion `%s' failed") at gmessages.c:517 #2 0xb748540b in g_return_if_fail_warning (log_domain=0xb7ac6ba7 "Gtk", pretty_function=0xb7b7875d "gtk_widget_event", expression=0xb7b76be8 "WIDGET_REALIZED_FOR_EVENT (widget, event)") at gmessages.c:532 #3 0xb7a87769 in IA__gtk_widget_event (widget=0x833e288, event=0x834b900) at gtkwidget.c:3927 #4 0xb7a95354 in IA__gtk_window_propagate_key_event (window=0x81f0808, event=0x834b900) at gtkwindow.c:4799 #5 0xb7a99aec in gtk_window_key_press_event (widget=0x81f0808, event=0x834b900) at gtkwindow.c:4829 #6 0xb79508f2 in _gtk_marshal_BOOLEAN__BOXED (closure=0x81d69f8, return_value=0xbf93f6f0, n_param_values=2, param_values=0xbf93f7fc, invocation_hint=0xbf93f6dc,
    marshal_data=0xb7a99a90) at gtkmarshalers.c:84
#7 0xb75185b7 in g_type_class_meta_marshal (closure=0x81d69f8, return_value=0xbf93f6f0, n_param_values=2, param_values=0xbf93f7fc, invocation_hint=0xbf93f6dc,
    marshal_data=0xcc) at gclosure.c:567
...

and on it goes. None of my stuff there except below gtk_main. Now unfortunately the assertion dos not tell which widget is not realized. So I do:
  (gdb) select-frame 3
  (gdb) print
g_type_name(((GTypeClass*)((GTypeInstance*)widget)->g_class)->g_type)
  $1 = (gchar *) 0x8335450 "BtPatternView"

Well this is a subclassed widget that is on the 2nd tab of the notbook. The "BtPatternView" subclasses a GtkTreeView, overrides realize, unrealize, expose, dispose and finalize. It does the chaining up.

When I initially click thru all tabs (so that they get realized it infact works). Explicitely calling gtk_widget_show() on it doesn't help. So any idea what goes wrong here?

i am testing with gtk+ 2.10.6 and svn trunk.

Stefan




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