[Geany-Devel] Python question

Pavel Roschin roshin at xxxxx
Fri Apr 25 04:44:26 UTC 2014

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:
		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

More information about the Devel mailing list