Re: GMC needs help with search dialog


I got no reply in almost two days.  Nobody likes GMC, except maybe Miguel,
but he's too busy with world domination plans :-)

> It is shame that the GMC doesn't have a functional file search.

Fixed enough to go into 4.5.55.  Not pretty, but it doesn't pretend to do
something that it cannot, as it was with the substring search in 4.5.54.

> GMC uses Gtk idle handler for the search.  The handler scans files for
> data (or just checks their names) and shows its status by changing text on
> a label (file gnome/gfind.c, function status_update).  Something is wrong
> with changing the label from the idle handler, because after some time GMC
> starts printing messages like:
> Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget
> with width 65316 and height 1

The problem disappeared when I put the label into a box.  I haven't found
any documentation saying to do so.  Also Gtk failed to tell me that I'm
wrong - I wasn't trying to "allocate widget with width 65316".  So I'm
assuming it's a bug in gtk-1.2.10.

> If I interrupt search by pressing Escape, I'm getting another message:
> Gtk-WARNING **: invalid cast from `(unknown)' to `GtkLabel'
> Gtk-CRITICAL **: file gtklabel.c: line 261 (gtk_label_set_text): assertion
> `GTK_IS_LABEL (label)' failed.
> It looks like that in this case gtk_label_set_text() is called after the
> dialog has been destroyed.

Exactly.  The idle handler wasn't unregistered in this case.  The solution
was to create the "destroy" handler and do it there instead of doing it is
three other places.

> It seems logical that changing the label should only be done while some
> kind of lock is held, so that the dialog doesn't go away in the meantime.

The `NEWS' file from gtk says that it might be the case for the old
versions (before 1.2.2).  Now the idle handler holds the lock.

> Thank you in advance!

Thanks to myself :-)

Pavel Roskin

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