gnunet-developers
[Top][All Lists]
Advanced

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

[GNUnet-developers] [Windows] gnunet-gtk


From: N. Durner
Subject: [GNUnet-developers] [Windows] gnunet-gtk
Date: Sun, 14 Mar 2004 22:31:18 +0100

Hi,

gnunet-gtk has display problems under Windows.
This is because GTK doesn't behave well with multi-threaded applications.
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?


    Nils





reply via email to

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