I'm played with GeanyPy plugin and faced with a problem.

Here is the source code I created to get current document from sidebar:

        def press(self, widget, event, data=None):
                if event.button != 2:
                        return
                mod, it = widget.get_selection().get_selected()
                doc = mod.get(it, 2)[0]

According to sidebar.c, mod.get(it, 2) should return pointer to Document.

But Python doesn't know that this is document and doc variable in this
example has type GPointer. How can I access to this document from python plugin?

P.S. I tried to use ctypes.cast, no success. Currently I'm addressing document
with a file path but it is a hack and isn't working for symlinks.

--
Best regards,
Pavel Roschin aka RPG
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel

Reply via email to