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

How to dynamically add/remove widgets from Gtk 3 Window

I am using python3 with Gtk3 and i need to basically remove some widgets from my Gtk.Window and replace them with other widgets when a Gtk.Button is clicked.I have tried using Gtk.ListBoxes with Gtk.ListBoxRows and so far i can remove all the Rows…
silverhash
  • 880
  • 8
  • 21
5
votes
1 answer

Checking to see if Gtk mainloop is running

Is there a way that I can check to see if the Gtk.main() loop is alive? Similar to the threading.is_alive() function? Any help is much appreciated :)
Daniel
  • 547
  • 5
  • 25
5
votes
1 answer

Using PangoCairo with PyGObject API

I am porting a Python2 script that uses Pango for drawing text to a Cairo surface. It works fine using the old PyGtk API with the pangocairo package. My system (Debian Jesse) doesn't have Python3 packages for PyGtk and instead uses the newer Gtk+…
Kevin Thibedeau
  • 3,299
  • 15
  • 26
5
votes
1 answer

GtkInfoBar doesn't show again after hide

I'm hide Gtk widget, then try to show it, but none of the methods "show()", "show_all()" or "show_now()" does't work. If not call "hide()" widget shows. python 3.5.2 gtk3 3.20.8 pygobject-devel 3.20.1 test.py: import gi gi.require_version('Gtk',…
Atterratio
  • 445
  • 2
  • 9
  • 25
5
votes
2 answers

How I create a "HeaderMenu" with a Popover menu in GTK?

I'm trying to create a "HeaderMenu" like this: But only I got it: I'm using GtkMenuButton within a GtkHeaderBar. How do I get a menu like the first picture? Codes: Glade file Python code
Matheus Saraiva
  • 1,144
  • 1
  • 11
  • 33
5
votes
1 answer

Segmentation fault when using `cairo.Region` in Python3 on Fedora 24

I'm trying to get an input shape to apply to a window, so I can have a transparent frame with only the interesting parts to be clickable, etc. I'm using Cairo graphics with PyGObject (Python 3). The Object is a regular Gtk Windows object, which then…
polemon
  • 4,722
  • 3
  • 37
  • 48
5
votes
3 answers

Show icon or color in Gtk TreeView tree

I am having difficulty loading a file or displaying a colour in one of the columns of a Gtk TreeView (Python binding of GTK3). An example taken from QGIS shows a icon in the first row and a blue circle in the second row. The colour is taken from the…
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
5
votes
3 answers

How I can get DrawingArea window handle in Gtk3?

I get this code on CEF Python 3 (link) ... self.container = gtk.DrawingArea() self.container.set_property('can-focus', True) self.container.connect('size-allocate', self.OnSize) self.container.show() ... windowID =…
ePhillipe
  • 73
  • 1
  • 7
5
votes
2 answers

Bundling GTK3+ with py2exe

Platform is Windows 7 64bit using python 2.7 and GTK3+ installed from http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar The exe is compiled but fails to run, due to this The following modules appear to be…
5
votes
2 answers

Detecting when a GTK window is done moving/resizing by the user

I want to detect when the user finished re-sizing or moving the GTK window. Basically an equivalent of WM_EXITSIZEMOVE in windows. I have looked at GTK detecting window resize from the user and am able to detect size/location changes using the…
Manny
  • 699
  • 6
  • 19
5
votes
2 answers

How to make global keyboard shortcuts with python (and Gtk3)?

I want to make keyboard shortcuts like t, that would work, when the main window is closed (but process is running, as the programme has a unity appindicator). I saw a package keybinder, but it seems, one can't use it with Gtk3 and pygobject. Or can?…
Phlya
  • 5,726
  • 4
  • 35
  • 54
5
votes
2 answers

What is the correct method to display a large popup menu?

A picture paints a thousand words...: In my Python 2.7 application I have a button which when clicked pops up a menu. In some circumstances this list is larger than the screen size. In Ubuntu 12.04 (uses Gtk 3.4.2) this is OK because you get…
fossfreedom
  • 2,903
  • 2
  • 19
  • 40
5
votes
1 answer

Writing MATE/GNOME Applets (Python) with PyGObject Introspection

So I have been trying to port a C GNOME applet to MATE, and after running into many different problems, I decided to rewrite it from scratch in python. Eventually, I found some not-horribly-out-of-date documentation, which is here:…
geniass
  • 371
  • 1
  • 9
  • 20
5
votes
2 answers

Use entry combobox when migrating to pygobject, glade and gtk3

I develop in python with glade and pygtk since 3 months, but even before I had time to get used to it, it was already obsolete. Using Archlinux, my system is constantly up to date, so I am forced to use gtk3 even if I found it a bit lacking of…
Zoé Martin
  • 1,887
  • 1
  • 16
  • 28
5
votes
2 answers

Converting PIL GdkPixbuf

How can I convert PIL Image in pixbuf?. I tried to change many examples but no solution import array from gi.repository import GdkPixbuf def image2pixbuf(self,im): arr = array.array('B', im.tostring()) height, width = im.size return…
Plaoo
  • 51
  • 3