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

How to correctly covert 3d array into continguous rgb bytes

I'm trying to convert the 3d array returned by cv2.imread to the continguous rgb byte array, in order to display in GTK. And below is my conversion code: def ndarr2rgb(img): r_arr = img[:, :, 0].ravel() # read channel g_arr = img[:, :,…
Philip Zhang
  • 627
  • 8
  • 17
4
votes
1 answer

How do I change the property of a GTK widget such as a stack?

I've been taking a quick look at the GTK 3.10 documentation for a GtkStack. https://developer.gnome.org/gtk3/3.10/GtkStack.html It mentions that the child added to a GtkStack is given a property "icon-name". My question is - how can I change the…
fossfreedom
  • 2,903
  • 2
  • 19
  • 40
4
votes
3 answers

installing pygobject on mac for Python 2.6

Does anyone know how to install PyGObject on Mac OSX for Python 2.6. The current distribution available on darwinports is using Python2.4. I want a package using Python2.6 Alternatively, has anyone tried installing it from sources on a Mac?
apt
  • 299
  • 1
  • 5
  • 12
4
votes
1 answer

Custom Gtk.Container with PyGObject

I'm trying to implement custom Gtk.Container with PyGObject. But i got problems and even dont know is this bug, or my implementation is wrong. This is my test code snippet: from gi.repository import Gtk, Gdk import sys class…
cheatfate
  • 41
  • 1
4
votes
2 answers

PyGTK+3 (PyGObject) to create screenshot?

I've spend past 3 days searching in google, how can I create a screenshot with PyGTK+3 ? There are gallizion tutorials about pyqt,pygtk+2,wx and PIL. By the way, I don't need external programs like scrot, imlib2, imagemagick and so on.
HexSFd
  • 217
  • 4
  • 9
4
votes
2 answers

How can i receive events from Skype via D-Bus using python?

(i know this resembles Python and d-bus: How to set up main loop? , but without complete code in the "Answer", i'm unable to figure out where i'm going wrong. it might just be a change in a Skype) Here is my program: import gobject import…
Rob Starling
  • 3,868
  • 3
  • 23
  • 40
4
votes
1 answer

Python threads don't work with pygobject?

Take a look at this trivial python gobject program: import threading import gobject import time def f(): while True: print "HELLO" time.sleep(1) threading.Thread(target=f).start() gobject.MainLoop().run() It spawns a thread…
Dog
  • 7,707
  • 8
  • 40
  • 74
4
votes
2 answers

How can I create a GTK ComboBox with images in Python?

How can I create a ComboBox that displays a list of entries, each containing some text and an icon? I'm using Python and GTK3 with GObject introspection.
Flimm
  • 136,138
  • 45
  • 251
  • 267
4
votes
1 answer

import errors with Python and Gtk+ 3

I'm working in a program that is written in Gtk+ 3 and Python. A related question I asked about my program is here. Now, that I advanced a bit more, I have the following imports: import aplpy import montage import subprocess from gi.repository…
skytux
  • 1,236
  • 2
  • 16
  • 19
4
votes
1 answer

python gtk gobject toggle visibility of windows

I wrote global shortcut example for hide and show my windows with key like 'F12', I used python-xlib and some script named 'pyxhook' everything works fine except when i want to hide() and show() window few times my proccess turning a zombie, but…
Özcan Esen
  • 340
  • 1
  • 13
4
votes
1 answer

Can't find gdk_property_change in PyGObject

What is gdk_property_change binding in PyGobject? I've tried Gdk.property_changed, Gdk.Property.change etc. Function Gdk.property_get exist and everything else works great. My system is: Ubuntu 12.10, Python 3.2.3, PyGObject 3.4.0 and Gtk 3.6.
4
votes
2 answers

What signals should I catch when scrolling in a Gtk ScrolledWindow?

I'm developing a python plugin for Rhythmbox - this contains a GtkScrolledWindow with a child which is a GtkIconView. The IconView is fed from a Gtk.TreeModel. It looks like this: Currently - and somewhat inefficient, every icon is drawn for every…
fossfreedom
  • 2,903
  • 2
  • 19
  • 40
4
votes
1 answer

Custom python widgets in glade 3

I would like to subclass an existing Gtk widget and get it to work with Glade3. The code is all python, and I'm using PyGObject. What I want to do is extend Gtk.TextView and be able to add it to my glade UI as if it were a native widget. I read…
Dan
  • 3,665
  • 1
  • 31
  • 39
4
votes
2 answers

API reference to WebKit WebView implementation in GTK (Python)

I'm working on a Python Gtk3 app on Ubuntu, which primarily uses WebView from WebKit. I couldn't find all the methods available to WebView object in python, currently I only know its open() method, so, where can I get detailed reference to all its…
Kushal
  • 3,112
  • 10
  • 50
  • 79
4
votes
1 answer

How to unset a timer set by python gobject.timeout_add ? threads?

I want to set timer in a thread and kill that thread when I want to unset the timer set by gobject.timeout_add, is this a good way to do this? basically I want to run a function for every 180 seconds but I want to be able to stop it whenever I want…
pahnin
  • 5,367
  • 12
  • 40
  • 57