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
Tag: pygobject
Gtk.Spinner in Python GTK while importing large library
I have a GTK application in C that will spawn a Python GTK process to embed a matplotlib figure into a window in the C process using GtkSocket/GtkPlug (uses XEmbed Protocol). The problem I am having is that the import of the matplotlib library takes about 2.5 seconds and during that time the socket widget is simply transparent. I would
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.
How to set the text size of Gtk.Entry in PyGObject?
I want increase the text size of Gtk.Entry . I am using Python3 Answer You can use Gtk.Entry.modify_font() to increase the size of the font. Here is an MCVE: