I just compiled exiv2 and gexiv2 for my debian machiene and now I want to start working with gexiv2 to edit IPTC data using python. The gexiv2 website presents the following line of code:
from gi.repository import GExiv2
But that already results…
I want to embed the Python interpreter into a program written in Vala to allow for some runtime scripting. I can run parts of my vala code from Python using Introspection, and I've found a rudimentary example of embedding the interpreter in Python…
i must write my own cell renderer with button, i came up with this:
#!/usr/bin/env python3
from gi.repository import Gtk
class CellRendererButton(Gtk.CellRenderer):
def __init__(self):
Gtk.CellRenderer.__init__(self)
def…
I'm developing another image viewer using Python and Gtk and the viewer is currently very simple: it consists of a GtkWindow with a GtkTreeView on the left side displaying the list of my images, and a GtkImage on the right side, displaying the…
The problem is basically this, in python's gobject and gtk bindings. Assume we have a class that binds to a signal when constructed:
class ClipboardMonitor (object):
def __init__(self):
clip = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)
…
There seems to be a distinct lack of documentation of the GObjects module for python at the moment, so maybe somebody can help me.
I am making an application which occasionally will have to notify the user that an event has occurred. I have found…
I'm in the process of writing a small/medium sized GUI application with PyGObject (the new introspection based bindings for Gtk). I started out with a reasonable test suite based on nose that was able to test most of the functions of my app by…
I'd like to create a Gtk.StatusIcon with custom text. Ideally I'd like to append this to an existing image, but text-only is ok, too. How can I achieve this?
I've seen some posts about getting a Gtk.Label's pixbuf but those methods seem to be…
In PyGtk I always used this to create a ListStore with an Image (using it with an IconView for displaying files):
store = gtk.ListStore(str, gtk.gdk.Pixbuf, bool)
But I can't figure out how to do this with Python 3 and PyGObject.
I have gstreamer installed on OSX 12.0.1 Monterey. I just installed the python bindings inside of a virtual environment running python 3.9 with:
pip3 install pycairo PyGObject
I can import gi and gi.repository.Gst without an issue. However it seems…
I'm new to coding and this is probably a stupid question...
I'm setting up a simple Gtk.ListStore(str) but as soon as I append(['whatever']) I get a "AttributeError: 'ListStore' object has no attribute 'insert_with_valuesv'".
I'm on Fedora 34(beta),…
I'm building a GUI with GTK-3 in Python using Glade. There is also a ListStore with its columns defined in the Glade file. Now I want to fill the ListStore with numeric values (there are int & float columns) that I receive as strings, so I need to…
When importing PyGObject in my Anaconda Python3.7 installation,
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
I get following error message:
ValueError: Namespace Gtk not available
I installed pygobject and…
There is no full documentation about how to use Gtk.Builder in PyGObject to create a menubar.
I don't use that Gtk.UIManager because it is deprecated.
The example code below is based on my experience with Gtk.UIManager.
In the example should appear…
I try to use SecretStorage in 2 Python processes, but when I try to update my Gtk.Window I get this message most of the time:
RuntimeError: Unable to initialize SecretService: Did not receive a
reply. Possible causes include: the remote…