Re: gtk+ and pthread

On Mon, 25 Mar 2002, Ro Stellar wrote:

> I am currently writing an application which, among other things, needs to
> continually receive data over a UDP connection and display this data in a
> gtk pixmap. I am having problems running pthread_create() (for receiving
> data via UDP) and gtk_main() (for display and other buttons) at the same
> time.
> As an alternative, I would like to do the following:
> 1. Put the UDP receive code into a callback function for a button
> 2. Associate this function with the click event for a button that will be
> created but not displayed
> 3. And... before I call gtk_main() set something so that this button always
> appears to be clicked or at least being clicked a few times a second or
> greater

This is not the way to do it. You should use gdk_input_add(....).

I attache an example on this.

Göran Hasse

> Is this, specifically the third step, possible? If so, a push/kick in the
> right direction would be greatly appreciated.
> Cheers,
> David
> _________________________________________________________________
> Send and receive Hotmail on your mobile device:
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@xxxxxxxxx

Göran Hasse email: gh@xxxxxxxxxx Tel: 08-6...

Raditex AB
Sickla Alle 7, 1tr Mob: 070-5530148

Attachment: InPanelUDP.c
Description: Text document