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
3
votes
1 answer

How to use the Python GTK3 (gi.repository) gdk_event_get_scroll_deltas() method

I'm attempting to port a Python program from GTK2 to GTK3. I understand the use of GDK_SMOOTH_SCROLL_MASK but can find no reference to an implementation of gdk_event_get_scroll_deltas().
Ryon Sherman
  • 1,553
  • 1
  • 11
  • 8
3
votes
1 answer

python gi.repository.gtk menu separators are missing

I want to show simple popup menu with right click, menu works right but menu separators are missing, I searched similar examples but they all using pygtk but I'm using gi.repository I don't know is my code wrong or this problem is all about…
Özcan Esen
  • 340
  • 1
  • 13
3
votes
0 answers

Gtk ComboBox width based on contents

I'm dynamically populating the options to a GTK3 ComboBox that has an Entry. Some the options can be quite long, and I'd like to be able to make the ComboBox wider if there are wide items in my model. Is there a way to do this? (It would be…
Dan
  • 3,665
  • 1
  • 31
  • 39
3
votes
1 answer

Why my gi.repository.Gtk keeps using GTK 2 modules?

I'm designing a GUI python program and I decided to use GTK+3. Reading some docs here: http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html I know that I could use the gi.repository.Gtk module as API to GTK+3 libs. But while I'm trying…
Chaser hkj
  • 305
  • 1
  • 2
  • 7
3
votes
3 answers

Cannot get pygobject to use a drawing area

Generally, I have been successful in using the Gtk3 system: Windows, boxes, grids, signal handlers etc. But, no matter what I try I cannot get a DrawingArea widget to work. I suspect something is wrong with my set-up but do not know how to check. …
Mike
  • 101
  • 1
  • 8
3
votes
3 answers

GenericTreeModel with PyGObject Introspection Gtk+ 3?

I'm trying to write my own Gtk+3-TreeModel based on GenericTreeModel in Python3, but I this error: AttributeError: 'gi.repository.Gtk' object has no attribute 'GenericTreeModel' Has GenericTreeModel been renamed? Thanks in advance.
Jan Holthuis
  • 149
  • 10
3
votes
1 answer

How to use Gtk3 GtkTreeRowReference in Python

I'm trying to call Gtk3's GtkTreeRowReference() function without any success. I'm trying to delete multiple records from a ListStore using the associated TreeView's selection set to MULTIPLE mode. I want to save a TreeRowReference for each ListStore…
knutsondc
  • 515
  • 4
  • 14
3
votes
2 answers

Gtk.Treeview deselect row via signals and code

I'm using PyGObject but I think this is a question that could be adapted to all GTK, so if someone know how to do it using C or anything should work in python also. I have two treeview, Active and Inactive, I load data from a Sqlite database and I…
andyinno
  • 1,021
  • 2
  • 9
  • 24
2
votes
1 answer

Python GUI both compatible GTK2 and GTK3

I'd like to create a graphical interface in python2 with GTK+. For now I'm using gobject-introspection to use GTK3 but I'd like, if possible, to be compatible with GTK2 as well. #!/usr/bin/python2 try: from gi.repository import Gtk except: …
Martin Trigaux
  • 5,311
  • 9
  • 45
  • 58
2
votes
1 answer

DrawingArea Cannot Get XID

I have the following Python 2.7/PyGObject 3.0/PyGST 0.10 module: from gi.repository import Gtk, Gdk, GdkPixbuf import pango import pygst pygst.require('0.10') import gst import Trailcrest import os, sys import cairo from math import pi class…
CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
2
votes
1 answer

gtk3 get settings value from GtkSettings

I want to programmatically retrieve the value of the word wrap setting for GEdit3 from inside a Python plugin. The GtkSettings class provides a method to set a string property, but how does one retrieve the value of a string property? I see no…
kostmo
  • 6,222
  • 4
  • 40
  • 51
2
votes
1 answer

Is it possible to remove button borders on Gtk4 Button in Python?

Is it possible to remove or change button borders for Gtk4 buttons? The buttons have borders as shown here: My intention is to create a list of Buttons in a vertical box that are clickable for their clicked signal. Based on the doc for a Button I…
airblast
  • 139
  • 1
  • 9
2
votes
0 answers

What are the responsibilities of size_allocate() in a custom container class? How does it relate to adjust_size_allocation()?

I try to create a proper container Class for Gtk in Python (MyBin in the code below). There seems to be no authoritative documentation on how to do that, only bits and pieces, which I glued together with trial and error. – There are many open…
Robert Siemer
  • 32,405
  • 11
  • 84
  • 94
2
votes
0 answers

ModuleNotFoundError: No module named 'gi'. Can't get PyGObject installed

I've been trying to solve this issue for about a week or two now, still haven't found a solution. I'm on Arch Linux. Here's what I've tried so far: installed python-gobject and gobject-introspection through pacman installed pycairo through…
2
votes
1 answer

PyGobject GTK app doesn't start without DBus session-bus even though the app doesn't use dbus

So, I made a notes app in Python using PyGobject. It's all well and cool, except it absolutely refuses to start up if I take away its' dbus permissions. While it wouldn't be a huge problem if I packaged it as a deb or something, it is since I'm…
vega-d
  • 21
  • 2