Skip to content
Advertisement

Tag: pygobject

code completion support with gi.repository in VS Code

I’m trying do code a simple app with GTK4 in Python using VS Code. What I do: I don’t have any auto completion or type hints in my IDE because gi.repository uses dynamic imports, is there any way to change this behavior? Answer In Python typing annotations can be written separately from the main module code (in .pyi files or

PyGObject: How to create hamburger menu programmatically

I would like to create a “primary menu” programmatically, which I believe is also called a “hamburger menu”. I have done several of these while working on web development side, but I have never done these using Python and GTK. This topic seems to be controversial and there are a lot of different solutions out there. I would like to

How do you add an inline image to PyGObject 3?

I want to put inline images into my PyGObject 3 programs so they won’t have to be loaded from disk. YoLinux shows how to edit an XPM file so its text can be inserted into Python code. The free e-book “PyGTK 2.0 Tutorial” by John Finlay gives two code examples. All that’s for PyGTK 2 not gi / PyGObject 3.

Advertisement