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




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



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