Re: Pass 2 or more widgets in callback
- From: Paulo Schreiner <paulo bewnet com br>
- To: Carlos Pereira <carlos pehoe civil ist utl pt>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Pass 2 or more widgets in callback
- Date: 25 Feb 2001 17:27:08 -0300
I have a doubt. I have a program, that listens on port 3000. Then, i
defined an idle function, wich accepts incoming connections and binds
the incoming connection to a IO callback (gdk_input_add).
But i have to remove the callback when the connection is finished, so I
did a
g_malloc(sizeof int), and passed the tag return by gdk_input_add to the
callback this way:
*tag = gdk_input_add(read_socket, GDK_INPUT_READ,
GTK_SIGNAL_FUNC(ler_socket), tag);
Then, inside the ler_socket function, i read the socket, and, if the
connect was ended, i did a gdk_input_remove(*tag) and a g_free(tag), so
that i dint have any leaks.
It worked ok (at least it seemed). But i was printing the data to the
console. Now, i want to set the text of a gtk_label with the data. I
cant set the tag as a _set_data, becouse there will be many diferent
tags (each connection) to only 1 widget.
So, i think the best would be to pass an array with tag and label. But i
just can't get it to work.
Does anyone have a tip, a code sample of how to do this?
Thanks in advance,
Paulo Schreiner
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]