gnunet-developers
[Top][All Lists]
Advanced

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

Re: [GNUnet-developers] [Windows] gnunet-gtk


From: Christian Grothoff
Subject: Re: [GNUnet-developers] [Windows] gnunet-gtk
Date: Mon, 15 Mar 2004 03:26:27 -0500
User-agent: KMail/1.6.1

On Sunday 14 March 2004 16:31, N. Durner wrote:
> Hi,
>
> gnunet-gtk has display problems under Windows.
> This is because GTK doesn't behave well with multi-threaded applications.

Specifically under Windows or in general?  

> gtk_window_new and _destroy only work from within the main thread.
> A workaround is to let the GTK main-loop call a callback function which
> does the actual GTK work. It would look like that:
> --- helper.c
> gint doGuiMessage(char *note)
> {
>   ...
>   gtk_window_new(...
>   ...
> }
>
> void guiMessage(const char *format, ...)
> {
>   ...
>   note = g_strdup_vprintf(...
>   ...
>   gtk_idle_add(doGuiMessage, note);
> }
> ---
> A call to guiMessage() registeres doGuiMessage() to be called from the
> main-loop. As soon as the main-loop is idle, it calls doGuiMessage() which
> in turn creates the message window.
>
>
> Any objections?

Not really.  If you intend to cleanup gnunet-gtk threading, you may also want 
to consult with Igor who put something about that and gnunet-gtk into the 
todo list (not all threads are properly stopped during shutdown or so); maybe 
that can easily be resolved at the same time :-).

Christian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]