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
15
votes
4 answers

I'm completly confused with PyObject, PyGTK and GNOME 3 as well

I installed Fedora 15 to use Python3 and GObject to develop a desktop-application, because PyGTK looks outdated: PyGTK 2.24.0 released Friday 01 April 2011 by Rafael Villar Burke PyGTK 2.24.0 has been released. This is a stable release…
quantez
  • 191
  • 1
  • 1
  • 4
14
votes
2 answers

How can I get the default colors in GTK?

Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on…
JohnW
  • 505
  • 3
  • 14
13
votes
5 answers

ModuleNotFoundError: No module named 'gi'

I am trying to run the following program: import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst Bu I am getting: Traceback (most recent call last): File "application.py", line 2, in import…
Gabrielle
  • 812
  • 2
  • 7
  • 28
13
votes
2 answers

Python and d-bus: How to set up main loop?

I have a problem with python and dbus. I checked out the developer docs and specifications, but I don't understand how to set up a main loop. I want to listen for notification events. See http://dbus.freedesktop.org/doc/dbus-python/doc/…
f4lco
  • 3,728
  • 5
  • 28
  • 53
13
votes
5 answers

Gtk3 keys bindings in css files

Where can I find an exhaustive list of available keybindings that a user can define in a CSS file for GTK+ 3? I have already checked those…
cedlemo
  • 3,205
  • 3
  • 32
  • 50
13
votes
1 answer

Serialize Gtk TreeStore / ListStore using JSON

I made a new example which shows much better what I am trying to do. The new example gives the following ouput. Is there a way that the data can go into the respective store key (the {} brackets)? { "copy": [ [ [ …
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
12
votes
2 answers

Displaying PDF files with python3

I want to write a python3/PyGTK3 application that displays PDF files and I was not able to find a python package that allows me to do that. There is pypoppler, but it looks outdated (?) and does not seem to support python3 (?) Do you have any…
Fabian Henze
  • 980
  • 1
  • 10
  • 27
12
votes
2 answers

Use glade with pygobject Gtk3

I am converting a script to use Gtk3 using the migration guide (Porting GTK2 to GTK3). I converted my import pygtk to a from gi.repository import Gtk and so on... I'm stuck because the glade module was loaded from module gtk: import gtk import…
MP0
  • 1,033
  • 2
  • 10
  • 17
12
votes
1 answer

installing PyGObject via pip in virtualenv

I'm actually upgrading an old django app from python2.7 to python3.4. While installing pygobject via pip, I got this error: Collecting pygobject Using cached pygobject-2.28.3.tar.bz2 Complete output from command python setup.py egg_info: …
MicroCheapFx
  • 392
  • 1
  • 2
  • 15
12
votes
5 answers

How do I install PyGTK / PyGobject on Windows with Python 2.6?

I have an application which depends on PyGTK, PyGobject, and PyCairo that I built to work on Linux. I want to port it over to windows, but when I execute import gobject I get this: Traceback (most recent call last): import gobject File…
lfaraone
  • 49,562
  • 17
  • 52
  • 70
12
votes
3 answers

Displaying an image with Pygobject and Python 3 from in-memory data

I have some RGBA data in Python 3 and I want to display the image it represents in a GTK3 window without using any extra libraries. First thing I tried was editing a Pixbuf's data as in an example…
ikn
  • 123
  • 1
  • 6
11
votes
2 answers

Gtk.StatusIcon PopupMenu in python

im trying to port some small examples from PyGTK to the new PyGobject bindings, but ive hit a roadblock with a popupmenu, despite getting no errors, no menu is being shown on rightclick, here is the code, from gi.repository import Gtk class…
Mike
  • 400
  • 2
  • 12
11
votes
3 answers

How to get the background color of a widget in GTK and Python?

I want to get the normal background color of a widget (a GtkHeaderBar, in this case). I'm currently using style = self.get_titlebar().get_style_context() to get the style, and color = style.get_property("background-color",…
user3474251
  • 209
  • 2
  • 12
10
votes
1 answer

Right Click Menu (context menu) using PyGTK

So I'm still fairly new to Python, and have been learning for a couple months, but one thing I'm trying to figure out is say you have a basic window... #!/usr/bin/env python import sys, os import pygtk, gtk, gobject class app: def…
Michael Schwartz
  • 8,153
  • 14
  • 81
  • 144
10
votes
1 answer

File msvc_recommended_pragmas.h missing while installing PyGObject via pip

I tried to install PyGObject via pip and it fails with given error: Building wheels for collected packages: pygobject Building wheel for pygobject (PEP 517) ... error ERROR: Command errored out with exit status 1: C:\Program Files (x86)\Microsoft…
Tr3nchHvlk
  • 137
  • 1
  • 6
1
2
3
54 55