Gtk2::Dialog's response signal no longer b0rken



if you've used Gtk2::Dialog, you may have noticed that there's an annoying difference between the value returned by $dialog->run and the second parameter to $dialog's "response" signal.

the GtkDialog's response ids are integers with some known values --- the values of the GtkResponseType enum are negative numbers, and positive numbers are fair game for application-specific use. gtk2-perl's binding for gtk_dialog_run() returns the stringified enum value for known values, and passes unknown values unaltered.

unfortunately, gtk defines the response_id parameter of the dialog's "response" signal as a plain old gint, meaning the gtk2-perl marshaling code doesn't know to do anything special for it. this means that the response id comes to the signal handler for GTK_RESPONSE_OK is -5 instead of 'ok'...


i fixed this today. now the value you get in the response signal is the same as that returned by $dialog->run.

since this signal is no longer broken, the Gtk2::Dialog::Responses module that appeared in 1.00rc1 will disappear again in 1.00rc2. sorry for the churn, but, well, it's not broken anymore.


the fix, actually, involved adding some infrastructure to Glib to allow the bindings to specify custom marshallers for specific signals. this gives binding writers a way to work around bugs in the libraries they are wrapping. check out gperl_signal_set_marshaller_for() in the bleeding edge cvs version of Glib.

--
muppet <scott at asofyet dot org>




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