Re: [gtk-list] Re: CList updates
- From: Matt Goodall <mgg isotek co uk>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: CList updates
- Date: Fri, 14 Jan 2000 11:10:54 +0000
Matt Gilbert wrote:
> I just read this in the documentation also. I am
> stumped then. I have attached my code. Its not very
> long and hopefully reasonably readable. I am blocking
> on the socket read in the thread if that matters. I
> don't think it should. Thanks -Matt Gilbert
<snip>
Just a small point about your code. I'm fairly sure that *every* call to
the gtk and related libraries should be wrapped in a
gdk_thread_enter()/leave() block if that call is in a thread.
You call gtk_clist_set_column_width(), gtk_clist_freeze(),
gtk_clist_append() and gtk_clist_thaw() in the thread. Only
gtk_clist_append() is wrapped by the gdk_threads calls.
You should probably move the call to gtk_clist_set_column_width() into
main() and appending to the clist should be like this:
gdk_threads_enter();
gtk_clist_freeze(GTK_CLIST(the_info->clist));
gtk_clist_append((GtkCList *)the_info->clist, buffer);
gtk_clist_thaw(GTK_CLIST(the_info->clist));
gdk_threads_leave();
Also, I'm fairly sure that the freeze and thaw is only useful when
adding lots of stuff in one go.
This won't help with the problem though :-(.
Cheers, Matt.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]