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

Properly structure and highlight a GtkPopoverMenu using PyGObject

I am trying to make an example of a proper Gtk.HeaderBar with Gtk.PopoverMenus that shows how the different widgets are used. I looked at a lot of examples and code, but can't figure out, how to work the Gtk.ModelButton. Especially this sentence…
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
3
votes
1 answer

Implementing replacement label for depreciate Gtk 3.10+ stock buttons in PyGObject 3.16

I’m using Glade 3.18 to design interfaces that I later load with PyGObject from the gi module to create a Gtk 3.16 user interface. To have an example, let’s use the “OK” button. The reference manuals (for both Gtk 3 and GI) state…
Arcturus B
  • 5,181
  • 4
  • 31
  • 51
3
votes
1 answer

Shutdown system tray icon on PyGObject

My vision of the program: icon in tray, left click on icon opens a window with shutdown, reboot, etc. buttons. The new Gnome specification advises to use notifications instead. StatusIcon >! (Deprecated since version 3.14: Use notifications)…
srghma
  • 4,770
  • 2
  • 38
  • 54
3
votes
0 answers

TreeView drag and drop in PyGObject: drag-data-delete not called?

I am working on an example how to do drag-and-drop in a TreeView in PyGObject. I have something I don't understand: Why is the drag_data_delete function never called? This is the self contained example: from gi.repository import Gtk, Gdk class…
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
3
votes
1 answer

How to get raw bytes from GLib.GString in Python?

I have an application written in Python using GTK3 through the GObject introspection (Python 2.7 and PyGObject 3.14). I am trying to load a web page using WebKit and access the contents of all the resources it loads. I'm able to accomplish this by…
zeroSteiner
  • 53
  • 1
  • 5
3
votes
1 answer

Package PyGObject Python 3 program with pynsist?

I would like to package a Python3-PyGObject program with pynsist. The repository has an example for PyGTK and it made me think that it shouldn't be too hard to change the example. The example can be found…
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
3
votes
1 answer

Change the colour of pixels in a GdkPixbuf (GTK3)

I'm using Gtk.StatusIcon, and want to change the colour of some pixels; I have a working piece of code, this loads a 1x1 pixel PNG file with the colour I want to set, and then copies that to thhe icon Pixbuf. While this works, it has the obvious…
Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
3
votes
1 answer

Problem building PyGTK on CentOS

I am trying to build PyGTK on CentOS for a non-standard Python (2.6, vs the out-of-the-box 2.4). It requires that I first build pygobject. pygobject-2.18.0 fails at the configure step. The error messages is as follows: checking for GLIB - version >=…
Marcelo Cantos
  • 181,030
  • 38
  • 327
  • 365
3
votes
2 answers

Code completion in pycharm with introspective bindings

I'm learning python + gtk3+ so I was looking for an IDE to help me. Is there any way to get code completion with PyGObject? I've really tried EVERYTHING I can think of. I have pycharm build 138.2401 where this bug:…
3
votes
1 answer

How to pass selected Gtk TreeView row to Gtk TreeStore insert function?

I am trying to insert a row into a Gtk.TreeStore, for which I have to pass the selected row number from Gtk.TreeView. I found the solution for PyGTK but not for PyGObject. For PyGTK the insert function looks like this…
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
3
votes
1 answer

Create a custom widget with PyGObject

I am trying to create a custom widget with PyGObject. For example I want to create this CustomButton widget which adds an image and a label in a button (it's just for the example) : #!/usr/bin/python #-*- coding: utf-8 -* from gi.repository import…
ncrocfer
  • 2,542
  • 4
  • 33
  • 38
3
votes
3 answers

Python process does not exit on GTK loop exit

problem I am loosely following this Python GTK tutorial, but the Python process itself does not exit after the gtk main loop is exited, and does not respond to a terminal interrupt either--it has to be killed (SIGTERM). Here is my complete…
bright-star
  • 6,016
  • 6
  • 42
  • 81
3
votes
1 answer

Linux/Python: Monitor /proc/acpi files without polling?

Is there any way to monitor /proc files, such as /proc/acpi/battery/BAT0/state /proc/acpi/ac_adapter/ADP0/state in a non-polling fashion, similar to inotify on a normal filesystem? I want to do this in a PyGTK app, so I tried using PyGObject's…
ezod
  • 7,261
  • 2
  • 24
  • 34
3
votes
2 answers

Python PyGObject Get pixel from GdkPixbuf.get_pixels()

I've written a python program using GTK+2 (pygtk). Now I want to update the program to GTK+3, so I have to use pyGObject instead of pygtk. My problem is, that I have to get the color from individual pixels on a GdkPixbuf.Pixbuf object. In pygtk i…
freundTech
  • 111
  • 9
3
votes
1 answer

Bundling GTK3+ with cx_freeze

Platform is Windows 7 64bit using python 2.7 and GTK3 installed from http://games.2g2s.de/?page_id=223 and PyGobject from here http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar I used the script provided on wiki: from cx_Freeze…
D.Andreea
  • 41
  • 2