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

How do I import Gtk in Python 3 on Windows 7?

I am new to python and trying to run a program with Gtk on Python 3.4 and Windows 7. I installed Python 3.4, the GTK+ all-in-one-bundle for Windows and PyGObject (which your are apparently supposed to use with Python 3+ now). However, I am always…
magnattic
  • 12,638
  • 13
  • 62
  • 115
0
votes
1 answer

How to implement the abolition of actions?

I write some simple program with Python and PyGObject. I wanted her to inform the user about the progress through the ProgressBar. I googled that this process should be a separate thread, otherwise the interface hold on, and now have some like this…
Atterratio
  • 445
  • 2
  • 9
  • 25
0
votes
2 answers

Can I add element in code so that I could get it later through Gtk.Builder()?

I use Python 3+PyGObjects+Gtk.Builder I have some window, what I create from glade: builder = Gtk.Builder() builder.add_from_file("main.ui") I create some widgets and add them(i see it in window): switch = Gtk.Switch() switch.set_name('test') hBox…
Atterratio
  • 445
  • 2
  • 9
  • 25
0
votes
2 answers

STILL: PyCharm can not resolve PyGObject 3.0, but code runs fine

This question has been asked before [here]. At the time, it was a bug, and a feature has been requested, later on it was fixed and supposedly it should work. but in my case it still isn't. I have been trying and googling for about a week, yet still,…
YesserLab
  • 1
  • 1
0
votes
1 answer

GTK named stack childs

I am using a Gtk.Stack widget in PyGobject, and as i could not find any "tutorial" on how to use them, i supposed that each element of the Gtk.Stack has a name/tag. And so i made a few elements and connected to the stack…
SOMN
  • 351
  • 1
  • 3
  • 15
0
votes
2 answers

How to use Gtk.Button.clicked()? Wrong Number of arguments supplied

I am trying to build a graphical interface with python in GTK+/Pygobject, but i am having some trouble. Mainly with events. What do i need? To execute a simple function whenever a button is clicked. Sample code: class Window(Gtk.Window): def…
SOMN
  • 351
  • 1
  • 3
  • 15
0
votes
2 answers

how to use GLib.io_add_watch in backwards-compatible code?

While running some older Python+GTK3 code under Ubuntu 14.04, the following deprecation warnings appeared: PyGIDeprecationWarning: io_add_watch is deprecated; use GLib.io_add_watch instead /usr/lib/python3/dist-packages/gi/overrides/GLib.py:655:…
oliver
  • 6,204
  • 9
  • 46
  • 50
0
votes
1 answer

PyGObject custom widget: how to draw an invalidated region?

I know that you need to subclass Gtk.DrawingArea in PyGObject in order to create a custom widget. You then connect the draw signal to a callback that looks like this: def on_draw(drawing_area, cr): # do something with cr return False To ask…
eepp
  • 7,255
  • 1
  • 38
  • 56
0
votes
2 answers

Modify specific XML from python?

I'm trying to modify an XML attribute every time my program starts. Basically, I'm creating a GUI with PyGObject, and I want the version number in the about box to automatically update. The XML is as follows:
Cody Dostal
  • 311
  • 1
  • 3
  • 13
0
votes
1 answer

Where TreeModel in GTK3 (PyGI) gets its first iter to call do_iter_next(iter)?

I've implemented a custom TreeModel in PyGI (GTK3) the following way (as suggested here and here): test.py from gi.repository import Gtk class Store(GObject.Object, Gtk.TreeModel): def __init__(self): self.data = [[i*j for i in…
Boris Burkov
  • 13,420
  • 17
  • 74
  • 109
0
votes
1 answer

pygobject cairo bindings are not working on Ubuntu 13.10

I get an error Couldn't find conversion for foreign struct 'cairo.Context' in ignored All the research I've done online suggests that there is a missing package python-gi-cairo, or…
sugarmuff
  • 435
  • 5
  • 17
0
votes
1 answer

GObject.add_emission_hook usage

I was kindly directed to use GObject's "add_emission_hook" following a recent question on SO but I can't seem to find a usage example. Does anyone have one to share, please?
jldupont
  • 93,734
  • 56
  • 203
  • 318
0
votes
1 answer

pygobject IconView interactive search

I'm using Python 3 with pygobject and I have an IconView and would like the user to be able to start typing and the IconView will select the first match. This already works in the TreeView widget, interactive search, but is there anyway to get this…
zedth2
  • 1
0
votes
3 answers

How to properly install PyGObject with Glade on OS X Mavericks

I'm using OS X Mavericks with system Python 2.7. I installed PyGObject, GTK+ and glade as I descripted below, but Python doesn't see gtk.glade module. All libraries from Homebrew: brew install libglade brew install gtk+ brew install pygobject Also,…
Kayne
  • 47
  • 1
  • 10
0
votes
1 answer

Getting a list of all GStream Syncs in Python using gi.repository

So if I use gst, I can run the following: import gst outs = gst.element_factory_list_get_elements(gst.ELEMENT_FACTORY_TYPE_SINK,gst.RANK_NONE) And outs is now a list of gst.ElementFactory objects which each of type of GStreamer SINK I can use (e.g.…
djsumdog
  • 2,560
  • 1
  • 29
  • 55