I'm trying to develop a GTK application in Python and I'm really stuck with the correct usage of a gtk.TreeStore. My main problem: I've already parsed some JSON and I have my own data structure which ist basically a Python list and two kinds of…
I have a small application that uses a DrawingArea to draw a simple map using PyGObject and GTK3.
I load a Pixbuf using
from gi.repository import Gtk, GdkPixbuf
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size("logo.png", 25, 25)
and then try to…
I have a warning when I run my GTK (Python GObject introspection) application and I can't figure out its source. When the application is loading and I'm populating a GtkListStore, after the very first time I append a row, I get the following…
Over the last few days of headaches, I've found 3 possible methods to do this, all of which have issues.
PyGObject's pip install fails due to a lack of Cairo and probably other dependencies. While this would be my preferred method, it would…
I have the following two threads:
myThread = threading.Thread(target=sender.mainloop.run, daemon=True)
myThread.start()
myThread2 = threading.Thread(target=receiver.mainloop.run, daemon=True)
myThread2.start()
The targets are GObject.Mainloop()…
I'm assembling a GUI using PyGObject. This Python code works in context. I get a toolbar button with the stock "Open" icon.
from gi.repository import Gtk
# ...
toolbar =…
I have a simple PyGObject application:
from gi.repository import Gtk
class Window(Gtk.Window):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.set_border_width(5)
self.button =…
Pictures will explain the title:
Under LMDE & Ubuntu 12.04 my GtkIconView looks like this - its correct in terms of the spacing between the icons:
Under Ubuntu 12.10, 13.04 & Fedora 17 the same code displays as follows:
N.B. - This is a rhythmbox…
If a GSettings schema exists and has been compiled, there is usually no problem reading from it. However, if it doesn't exist, an error is usually thrown which cannot be handled. Try this in a Python file or console:
from gi.repository import…
I'm trying to use a Glade file that has a GtkSourceView widget in PyGObject. I've wrote a little guide on how to start using the new GtkSourceView 3.0 in Glade: http://cjenkins.wordpress.com/2012/05/08/use-gtksourceview-widget-in-glade/
The problem…
Sometimes I need to call a gtk/gobject function that only exists in C, but returns an object that has a python wrapper. Previously I used a solution based on ctypes that worked well:
http://faq.pygtk.org/index.py?req=show&file=faq23.041.htp
Now that…
One of the great things of python is the ability to have introspection on methods and functions. As an example, to get the function signature of math.log you can (in ipython) run this:
In [1]: math.log?
Type: builtin_function_or_method
Base…