Questions tagged [pygobject]

GTK+ and other GObject bindings are provided by PyGObject through introspection.

Python library providing bindings for GObject based libraries through GObject-Introspection.

For more information:

817 questions
4
votes
1 answer

Drawing in PyGobject (python3)

I'm trying to write simple graphic editor using PyGObject and python 3. I need to draw lines with different color and width using mouse. I found many examples like this but nothing more complex. How do I save drawn image between 'draw' events? Is…
zaquest
  • 2,030
  • 17
  • 25
3
votes
1 answer

How to create python bindings for a glib/gobject based library

I would like to create Python3 bindings for a glib/gobject based library, namely infinote/libinfinity. I am a bit puzzled about the necessary steps to accomplish this. Does PyGObject help here or not? Is this guide still valid for python3 and…
Fabian Henze
  • 980
  • 1
  • 10
  • 27
3
votes
1 answer

GtkClutter Actor signals not firing

I'm trying to write an app using GtkClutter but I can't get the actors to fire signals. Here is a sample from gi.repository import GtkClutter, Clutter, Gtk, Gdk GtkClutter.init([]) class MyCanvas(GtkClutter.Embed): __gtype_name__ =…
user250145
3
votes
1 answer

adding items to treeview in PyGObject

I have a GUI created in Glade, and I would like to populate the treeview widget. Here is the relevant part of my code def __init__(self): ..... self.fill_store() self.add_column(self.widget('treeview_preview')) …
v923z
  • 1,237
  • 5
  • 15
  • 25
3
votes
2 answers

ERROR: Could not build wheels for PyGObject, which is required to install pyproject.toml-based projects

So I've been trying to install the PyGObject library but it keeps giving me this error while building the wheel: gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory error:…
vibhav950
  • 31
  • 5
3
votes
4 answers

Buildout: use dependencies from system Python

I'm trying to use buildout for a Python package which, when used, depends on 2 extension modules: dbus-python and pygobject. Both modules make buildout fail: dbus-python lacks a setup.py file, while pygobject has one but whose usage is discouraged…
Oben Sonne
  • 9,893
  • 2
  • 40
  • 61
3
votes
0 answers

How to get rid of the white vertical line in a python gtk 3.0 window

I'm about to create a desktop based widget application using python via the gi.repository and the Gtk/Gdk v3.0. The goal is to have the window taking the whole screen being transparent, frameless and not accepting any focus. In addition it should be…
tzeikob
  • 31
  • 2
3
votes
1 answer

Gtk does not save text to the clipboard if I close the app right after

I'm new to Gnome development. I am trying do create a button which, when pressed, will copy the content of its label to the clipboard and closes the app. This is my code, where "self" is a class that extends Gtk.Window. If I don't close the app, it…
mijorus
  • 111
  • 1
  • 7
3
votes
0 answers

Getting segmentation fault in import gi.repository in Python PyGobject?

I have installed gstreamer from source using cerbero with the help of this link (https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-cerbero.html?gi-language=c) All the packages are installed in the cerbero…
3
votes
1 answer

pydev on aptana3 unable to import gi.repository

the following code should work import gi import gi.repository this works in a python shell. And it also works if I save the file as a script then launch it in a terminal. but in aptana3 i get this: import gi.repository ImportError: No module named…
code shogan
  • 839
  • 2
  • 9
  • 25
3
votes
1 answer

GTK3: listen to theme changes

I'm looking for a way, on a PyGObject application, to be notified when there is a theme change. I need this notification because I'm plotting a graph using matplotlib and I'm setting as text color for the Graph the standard label color of the…
Roberto Leinardi
  • 10,641
  • 6
  • 65
  • 69
3
votes
2 answers

What is the gnome keyring api for PyGi?

Does anyone where I can find the gnome keyring api in PyGi? I used to do: import gnomekeyring Now I want to use the new python/gobject introspection so it would be something like: from gi.repository import GnomeKeyring But I can't find the module…
Leon
  • 841
  • 3
  • 10
  • 21
3
votes
2 answers

PyCharm: Cannot find reference 'Gtk' in '__init__.py'

I have a clean virtual environment conda create --name gtk python=3.8 conda install -c conda-forge pygobject gtk3 When I add the import from gi.repository import Gtk according to the PyGTK3 wiki. PyCharm complains saying Cannot find reference…
Dhruvan Ganesh
  • 1,502
  • 1
  • 18
  • 30
3
votes
0 answers

Python Exceptions are not propagated/printed when they occur in Glib/DBUS loop

When an error/exception (such as a NameError because I typo'd a variable name) occurs in notification_filter -- the error/exception information doesn't appear to be propagated (or is caught silently). A simple example: import dbus from…
3
votes
2 answers

Find / Generate documentation for Gtk, Gdk, GdkPixbuf,

Where can I find proper documentation on the Python objects Gtk, Gdk,... from gi.repository ? I'm stuck with using dir() and it's of the utmost annoyance... To sum it up: heelp! (NOTE: the pygtk doc is too outdated, I'm using pygobject)
MP0
  • 1,033
  • 2
  • 10
  • 17