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: http://mobile.msn.com

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


----------------------------------------------------------------
Göran Hasse            email: gh raditex se     Tel: 08-6949270
Raditex AB             http://www.raditex.se
Sickla Alle 7, 1tr                              Mob: 070-5530148
131 34  NACKA, SWEDEN

Attachment: InPanelUDP.c
Description: Text document



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