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
0 answers

How to perform cleanup after custom Gtk widget is destroyed?

I have a custom Gtk widget like MyWidget defined in the code example below: import gc import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MyWidget(Gtk.Button): def __init__(self, **kwargs): …
eugenhu
  • 1,168
  • 13
  • 22
3
votes
1 answer

Package gobject-introspection-1.0 was not found in the pkg-config search path in ubuntu

this is the error i am getting while uploading my project to heroku. remote: running build_ext remote: Package gobject-introspection-1.0 was not found in the pkg-config search path. remote: Perhaps you should add the…
Anand Prem
  • 51
  • 2
  • 4
3
votes
2 answers

How can I get a list of windows with Wnck, using PyGI?

I just started using PyGI (on Ubuntu Natty), although I have never used pygtk before. I have used wnck in a wxPython program though, and it was easy enough to get a list of currently opened windows. From PyGI, the window list is always…
crazedpsyc
  • 65
  • 1
  • 4
3
votes
1 answer

How to create a gsignal without parameters in pygtk

The pygtk signal documentation is pretty clear about signals creation, but I could not create a signal that doesn't take parameters. What I want is to define (like in the example): class MyGObjectClass(gobject.GObject): __gsignals__ = { …
alexef
  • 442
  • 2
  • 13
3
votes
1 answer

Pyinstaller on Msys2 with pygobject

I have been building an application on Linux using python pygobject, and now I need to distribute it on Windows. I first installed pygobject via msys2 (as per the official pygobject documentation) Now, using msys2/mingw32, I can run my program…
tbrugere
  • 755
  • 7
  • 17
3
votes
0 answers

cannot import gi module python 3.6 on mac

I am integrating gstreamer and pocketsphinx on mac using python 3.6; however, the first line of code, from gi import pygtkcompat, raises an error. The command: python3 demoapp_chinese.py returns Traceback (most recent call last): File…
Cindy
  • 315
  • 2
  • 19
3
votes
1 answer

How to pass/return data from Gtk dialog to main application class

I have an application in Python Gtk. I have my main Application class in my main file. I then have all my dialogs in a different file. I need to be able to pass/return custom data from the dialog to the main application class other than the standard…
Jamie Lindsey
  • 928
  • 14
  • 26
3
votes
1 answer

How to handle a "notify::active" signal from a Gtk.Switch? (MVC architecture)

I cannot figure out how to handle the notify::active signal of a Gtk.Switch. I'm working with the MVC architecture (pattern) suggested here. The error I got is this: TypeError: _on_switch_serial_toggled() missing 1 required positional argument:…
amartin1911
  • 512
  • 5
  • 11
3
votes
1 answer

Installing PyGObject through PyCharm yields error command 'C:\\...\\cl.exe' failed with exit status 2

I'm trying to install PyGObject on a Python2.7 environment in PyCharm which fails with the following details: Running setup.py clean for PyGObject Failed to build PyGObject Installing collected packages: PyGObject Running setup.py install for…
3
votes
1 answer

Get number of columns in Gtk.Grid?

My sample code below creates a 2 row x 10 column Grid. The len() of the Grid seems to print the number of widgets within, not the row or column count. How can I get the column count? import gi gi.require_version("Gtk", "3.0") from gi.repository…
Caprooja
  • 855
  • 7
  • 11
3
votes
1 answer

Invisible Gtk.EntryCompletion results when using with Glade

I am trying to get entry completion to work with Gtk on Python 3, but I seem to miss some points when using Glade to construct the interface. When using a layout based on a Glade file, I get a list of suggestions, but cannot read them since the…
epR8GaYuh
  • 311
  • 9
  • 21
3
votes
1 answer

GTK TreeView styling

Short version: What CSS selector can be used to style the background of a GTK TreeView header? Long version: I've tried treeview header, treeview header .button, .button, button, label, GtkTreeView header, header and * as selectors for the header…
Tom
  • 7,269
  • 1
  • 42
  • 69
3
votes
0 answers

PyGObject Install Child Properties by Creating ParamSpec

I'm trying to convert a pygtk library called etk.docking to pygobject. As part of this I have a Gtk.Container class that has child properties defined in a __gchild_properties__ dictionary. These object properties that are not specific to either the…
Dan Yeaw
  • 741
  • 8
  • 16
3
votes
1 answer

How to Add Placeholder on TextView Object in PyGObject

I've added placeholder on Entry object: self._widget = Gtk.Entry() self._widget.set_placeholder_text("Enter your name") Now I want to add placeholder on TextView object, but I didn't find any method for it: self._widget = Gtk.TextView()
mortymacs
  • 3,456
  • 3
  • 27
  • 53
3
votes
1 answer

Get menu entries of GDBusMenuModel with PyGObject

So because I have the unity-gtk-module installed, all gtk-applications export their menu over the dbus SessionBus. My goal is to extract a list of all available menu entries. I've already implemented this with the help of pydbus, but for some…
encomiastical
  • 143
  • 13