Re: Porting launcher-gtk.py to gobject introspection



On Thu, Dec 22, 2011 at 13:29, Nicolas Évrard <nicoe altern org> wrote:
> * Jiří Techet  [2011-12-21 22:15 +0100]:
>>
>> Hi Nicolas,
>
>
> Hello Jiří,
>
>
>> On Tue, Dec 20, 2011 at 15:50, Nicolas Évrard <nicoe altern org> wrote:
>>>
>>> Hello,
>>>
>>> I am trying to port the demos launcher-gtk.py to use gobject
>>> introspection. But I seem to be unable to grok the introspection
>>> concept.
>>>
>>> So I copied both launcher-gtk.py and markers.py to a directory from an
>>> old version of libchamplain and renamed everything to use the
>>> introspection. But my code fails on this kind of line (in markers.py):
>>>
>>>     marker = Champlain.marker_new_with_text(
>>>        "Montréal\n<span size=\"xx-small\">Québec</span>", "Serif 14",
>>> black,
>>>        orange)
>>>  I tried with Champlain.Marker("…") but it did not work,
>>> Champlain.Marker.new_with_text did not work either.
>>>
>>> Can someone explain me how to do this ?
>>
>>
>> First, the method called by the demo is
>> champlain_label_new_with_text() and not
>> champlain_marker_new_with_text() which appears you try to call (and
>> which doesn't exist).
>
>
> Well I took as an example the last version of launcher-gtk.py that I
> could find:
>
> http://gitorious.org/libchamplain/mainline/commit/c02e827d01762d39d709b2e4d7a58828dc800818/diffs
>

Ah, OK, that was using the old API - there will be more changes like
this if you want to convert it to the introspection-based bindings.

> BTW once I have finished rewritting those (I'll have some time on the
> 25 I guess) are you interested in the result ? It would probably help
> people looking for example I think.

Sure! Having more demos is always good both for new users and also for
testing all the features. At the moment libchamplain doesn't have many
demos testing introspection bindings and having a demo testing more
libchamplain features is certainly welcome.

Thanks!

Jiri


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