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



"muppet" wrote:

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

array/hash references work perfectly fine in $data;

Sure. But gtk-perl offered @data here. If we want to continue with that,
we have to turn that into a reference and dereference it, when calling 
the callback. Anyway it's not necessary to be close to gtk-perl here, so
we should drop it.

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.

Yep, sounds reasonable.

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 ?

Ok - but I think those helper functions should be collected in a 
separate module and not in the gtk2-perl-xs core. The core 
correspondents as close as possible to the C API - which makes 
documenting the Perl API needless, resp. we need to document the binding
principles only, not the details (as yourself suggested some time ago ;)

What about the namespace Gtk2::Helper (or probably Gtk2::Util) for such
functions? Widget wrappers could be placed there also, e.g. 
Gtk2::Helper::CList (if somebody want to have it ;)

Regards,

Joern

-- 
Joern Reder
supporting:   http://www.zyn.de/
unbelievable: http://www.exit1.org/
CPAN:         http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED




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