[47] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Proposal: change the interface to gdk_input_add

daemon@ATHENA.MIT.EDU (Owen Taylor)
Mon May 5 11:57:27 1997

To: gtk-list@redhat.com
From: Owen Taylor <owt1@cornell.edu>
Date: 05 May 1997 11:56:58 -0400
In-Reply-To: Owen Taylor's message of 04 May 1997 23:38:12 -0400
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com


I was fooling around some with gdk_input_add, and got it to do
some pretty cool things. (I wrote a mini FTP client in Perl that
forks off a child to do a get, and asynchronously updates a progress
bar based on information received back from the child.) But I 
think the interface should be made consistent with gtk_timeout_add,
and gtk_idle_add. (Largely to make things easier for writing non-C
bindings.)

The prototype for the callback function is now:

typedef void (*GdkInputFunction) (gpointer          data,
				  gint              source,
				  GdkInputCondition condition);
I think it should be:

typedef gint (*GdkInputFunction) (gint              source,
		 		  GdkInputCondition condition);
				  gpointer          data);

Moving the gpointer argument to the end allows code-sharing in
callback-handling glue code. 

Checking the return and removing the handler if it is non-zero
would be a nice consistency thing. I'd be happy to make the changes
if they were considered appropriate.

Regards,
                                        Owen

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post