Re: Should I use GTK+ or even GUI ?



Hi,

Thanks for your response. However, what I use is just GTK+2.1 in Red hat 8.0, and my codes like these:

GtkWidget *Clist_CommStatus;
GtkWidget *ScroWind_CommStatus;
GtkWidget *Window_Commstatus;

if(GTK_IS_WIDGET(Window_CommStatus) && GTK_IS_WIDGET(Clist_CommStatus))
{
 NROW ++;
        
gdk_threads_enter(); gtk_clist_append(GTK_CLIST(Clist_CommStatus), &pText);
 gdk_flush();
 gdk_threads_leave();
// gtk_clist_moveto(GTK_CLIST(Clist_CommStatus),(GTK_CLIST(Clist_CommStatus))->rows - 1,0,1.,0.);

 if(NROW >= 2000)
 {
    gdk_threads_enter();
    gtk_clist_remove(GTK_CLIST(Clist_CommStatus), NROW - 2000);
    gdk_flush();
gdk_threads_leave(); NROW --;
 }
}

Unfortunately, the error "Xlib: unexpected async reply" still exists.

: Stefan Kost <ensonic hora-obscura de>
To: jacky618 jacky618 <hhd618 hotmail com>
CC: gtk-app-devel-list gnome org
Subject: Re: Should I use GTK+ or even GUI ?
Date: Mon, 14 Feb 2005 13:14:24 +0100

hi hi,

reading CList sounds like gtk1.2, right. Maybe consider using gtk-2 as
gtk1.2 is
not recent.
And your "Xlib: unexpected async reply" sounds like you update the gtk
widget
from within a thread without proper thread locking.
In gtk-2 the methods to use are called gdk_threads_enter() and
gdk_threads_leave(). Dunno whats theri name in gtk1.2

Stefan

Btw. sending the mail once would be sufficient....
> Hi,
>    Recently I am writting a multi-thread program, which is a
> comunication application. In this program I need to display all
received
> messages on a CList control. Because the messages are successive coming
> in, I have to remove the old messages in this CList control
> continuously.  However, after a few hours, the program will halt
> automatically with a error:
>
> Xlib: unexpected async reply
>
> I have spend much time to resolve this problem with little effect. So,
I
> wonder whether I should use graphical interface to display those
messages.
>
> _________________________________________________________________
> 与联机的朋友进行交流,请使用 MSN Messenger:
http://messenger.msn.com/cn
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn



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