diff options
author | Jordan Halase <jordan@halase.me> | 2020-03-09 13:40:51 -0500 |
---|---|---|
committer | Jordan Halase <jordan@halase.me> | 2020-03-09 13:40:51 -0500 |
commit | 760fb45fab539d3b228076f64c3d6480e9e57fd7 (patch) | |
tree | 3860c2b5023c82eadf3d27358679b218930e8478 /readme.md |
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..cd78d67 --- /dev/null +++ b/readme.md @@ -0,0 +1,22 @@ +# PyGObject From C + +Normally when creating graphical user interfaces using [GTK](https://gtk.org), +one would choose to write their whole project in C or another programming +language for which GTK bindings exist. + +For this example, we wish to use [PyGObject](https://pygobject.readthedocs.io) +to write a GTK application in Python, due to its simplicity, ubiquity, and +ablilty to do rapid ad-hoc development. However, if our application is part of +a larger user interface *not* written in Python, we need a way to bridge the +interface between Python and the host language. + +This proof-of-concept bridges PyGObject and C so that one may create GTK-based +user interfaces in Python as part of a larger interface with a C interface. +It does this by extracting the raw `GObject` C-pointer from the user-defined +`PyGObject` and passes it as a `GtkWidget` to the host. + +Please note that this is a proof-of-concept and may have issues with memory +management, error handling, and versioning. Whether Python or GTK is a good +fit for plugin UI development is debatable, the motivation for creating this +is for rapid ad-hoc UI creation during the development stage only, and not +intended for use in production. |