|
From: Robert M. <rob...@de...> - 2003-04-07 05:24:41
|
On Sun, Apr 06, 2003 at 07:44:16PM -0400, Decklin Foster wrote: > This seems to not be quite as simple. I tried the obvious (OK, not that > obvious... why text_view is not a pointer escapes me): I think this is because GtkImHtml extends GtkTextView, so it's struct should contain the entirety of GtkTextView's as the first element, which in turn contains GtkTextView's parent, all the way up to GObject. This is easy to rectify, set the parent to the imhtml widget itself. > But that crashes when we try to destroy the widget. I don't get this > either, because we in buddy.c that tip window get destroyed and there's > no crash. I could kludge around it by doing this: The crash is more interesting. GtkTextView's parent turns out to be GtkContainer, for the purpose of embedding widgets like images and such, which means the removal of a child usually means shape-changing and stuff is necessary. When Gtk goes to free up the tooltip it winds up calling gtk_text_view_remove with the tooltip window as the parameter. This function implements gtk_container_remove in the textview special-case. Because we never actually added the tooltip to the textview as a child element, and nor is it sane or correct to, this function's sanity check (that it actually iterated through any child widgets) fails if the GtkImHtml has no smileys/images/HRs in. The best fix for this I can't really fathom. I don't even know why Cleanice calls any methods on the parent of the tooltip. Gtk2's default theme engine doesn't seem to. The Gtk2 tooltip code doesn't ever seem to set the parent on it's tip windows either. Maybe what we're actually doing is hacking around a bug in Cleanice that we tickle because we paint pango directly into our tip window, rather than using a GtkLabel like the real tooltips do, so maybe the NULL-setting hack is the best we can hope for. > But that's just icky. What should I be doing here? My GTK-fu is > extremely rusty. > > -- > things change. > de...@re... Regards, Rob |