Re: Bindings for a 3rd-party library



oops :) new laptop ... sent before i was ready ...

GtkFlow::Source->new()
GtkFlow::Sink->new()

 ... gives errors like:

Can't locate object method "new" via package "GtkFlow::Source"
(perhaps you forgot to load "GtkFlow::Source"?)

Also I can't list class methods by any method I know ( eg tried many
on 
http://stackoverflow.com/questions/910430/how-do-i-list-available-methods-on-a-given-object-or-package-in-perl
).

eg:

my @methods =   Class::Inspector->methods( 'Foo::Class', 'full', 'public' );

print Dumper( \ methods );

 ... prints an empty array.

Is this hidden by Glib::Introspection? Or is something else going wrong?

Also I didn't quite follow this:

"some of its functions — especially the ones that deal with collections
— will not be introspectable"

Collections? Not sure what you mean here. Anyway the python examples
seem to do basically all I'm interested in, so I'm hoping there is
just something simple I'm missing. Sorry - I don't understand the new
introspection stuff at all.

Dan

On Thu, Jul 9, 2015 at 4:00 PM, Daniel Kasak <d j kasak dk gmail com> wrote:
OK I'm returning to this after a long period of not doing anything ...

This part does *something:

Glib::Object::Introspection->setup(
    basename => 'GtkFlow'
  , version  => '0.2'
  , package  => 'GtkFlow'
);

 ... because if I don't adjust my LD_LIBRARY_PATH, I get errors about
missing libraries. When I set LD_LIBRARY_PATH to where I installed
libgtkflow, the errors disappear.

However, that's as far as I get. The next part:

GtkFlow::Source->new()
GtkFlow::Sink->new()

 ... gives errors like:


On Fri, May 22, 2015 at 9:17 PM, Emmanuele Bassi <ebassi gmail com> wrote:
Hi;

On 22 May 2015 at 12:11, Daniel Kasak <d j kasak dk gmail com> wrote:
On Fri, May 22, 2015 at 5:37 PM, "Torsten Schönfeld" <kaffeetisch gmx de> wrote:
"Daniel Kasak" <d j kasak dk gmail com>:
I'm wondering ... how much work is involved in getting Perl bindings
for this library working? I guess it would depend on how it's written?
Or does the introspection that comes along with gtk3 make it generally
an easy task?

Something like this should get you started:

  Glib::Object::Introspection->setup (
    basename => 'GtkFlow',
    version => '0.2',
    package => 'GtkFlow'); # or whatever package you prefer

  GtkFlow::Source->new (...)
  GtkFlow::Sink->new (...)

Aha. Thanks :)

Sadly, the library is written in Vala and uses Gee, which means that
some of its functions — especially the ones that deal with collections
— will not be introspectable, and thus will not be available in any
language *except* Vala.

Ciao,
 Emmanuele.

--
https://www.bassi.io
[ ] ebassi [ gmail com]


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