Re: [xs] Gtk2->input_add / Gtk2->input_remove



Jörn Reder said:
learned, that adding an IO watcher with Gtk 2.x indeed
isn't not as easy as in Gtk 1.x.

possible GLib mottos:
"with more power comes more responsibility"
"flexibility is inversely proportional to simplicity and ease of use"
"we'll give you enough rope to strangle yourself right well."

;-)


Also the connected 'read' callback is never called.

is this a bug or is it behaving as designed, but with an undesirable design?


in particular $data is @data in gtk-perl - I  found
no easy solution for that.

array/hash references work perfectly fine in $data; although they are arguably
not as clean, it's directly analogous to what you'd do in C (e.g., pass a
structure pointer).


I'm not sure, if we
really should offer this API redirection stuff here. Probably
croaking a recipe of doing it right may be a cleaner solution ;) Should I
commit it? Or do we throw away the whole deprecated wrapper stuff?

since the C-level stuff with the name input_add is deprecated, and you can't
exactly emulate it, don't put it in ... as input_add.

on the other hand, you can write a cleaner wrapper under a different name and
with a different, more suitable signature, and that would fall under the
category of "API extension".  there was a discussion on the list a bit ago
about what to do with API extensions and sugar; what ever came of that?


perhaps something like G::IO->add_watch_simple ?


-- 
muppet <scott at asofyet dot org>





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