lgi-devs / lgi

Dynamic Lua binding to GObject libraries using GObject-Introspection
MIT License
440 stars 70 forks source link

API reference such as https://lazka.github.io/pgi-docs/? #287

Closed ousia closed 2 years ago

ousia commented 2 years ago

I have a small Python script (using Gtk+3 and introspection) that I would like to “translate” to Lua.

I wonder whether there is something similar to https://lazka.github.io/pgi-docs/ but with the proper Lua names.

Sorry, this may constitute a misuse of an API reference, but this is the way I have to write a Lua version of a previous Python script.

Many thanks for your help.

psychon commented 2 years ago

Well.... I do not really know much about the "Gtk universe" and do not know how those pages were generated.

but with the proper Lua names.

I think the names in "Lua land" should be the same as in Python? Basically, all of these should use the GObject-Introspection data and that is based on the C function names. For example, gtk_widget_show(widget) ends up as a widget:show() in lgi and widget.show() in Python (where widget is a GtkWidget).

ousia commented 2 years ago

Well.... I do not really know much about the "Gtk universe" and do not know how those pages were generated.

Many thanks for your reply, @psychon.

I guess https://github.com/pygobject/pgi-docgen won’t help here.

It is the tool used to generate the PGI.

but with the proper Lua names.

I think the names in "Lua land" should be the same as in Python? Basically, all of these should use the GObject-Introspection data and that is based on the C function names. For example, gtk_widget_show(widget) ends up as a widget:show() in lgi and widget.show() in Python (where widget is a GtkWidget).

Fine, I will try that approach.