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
8
votes
2 answers

Gtk Switch activate signal not firing

I'm trying to use a Gtk.Switch widget in an app but "activate" signal is not firing by clicks. It works fine when using the widget with keyboard by hitting reture/space key on it but clicks don't fire the "activate" event. Any Idea what is to be…
user250145
8
votes
1 answer

"Allocating size to..." GTK Warning when using Gtk.TreeView inside Gtk.ScrolledWindow

I'm receiving the following warnings in my GTK 3 application: Gtk-WARNING **: Allocating size to __main__+MCVEWindow 0000000004e93b30 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate? The…
Doom8890
  • 435
  • 3
  • 15
8
votes
1 answer

How to create a complete menu using GIO Actions in PyGI GTK?

I'm trying to convert the menubar in my Gtk app so it will use GActions(from the Gio) as opposed of GtkActions in Python3 using GObject Instrospection. I've been trying to figure it out on my own but so far it seems awfully complicated and I didn't…
OdraEncoded
  • 3,064
  • 3
  • 20
  • 31
8
votes
2 answers

Gtk.CssProvider() how do ID based selectors work in Gtk3?

I've been fiddling with this on and off for a couple of days but just can't seem to come to grips with what the issues might be. Essentially I'm trying to style some Gtk Widgets in Gtk3 using CSS style declarations, nothing complicated but just…
jduren
  • 630
  • 5
  • 11
7
votes
3 answers

How do I raise a window that is minimized or covered with PyGObject?

I'd been using the answer provided in the PyGTK FAQ, but that doesn't seem to work with PyGObject. For your convenience, here is a test case that works with PyGTK, and then a translated version that doesn't work with PyGObject. PyGTK Version: import…
dumbmatter
  • 9,351
  • 7
  • 41
  • 80
7
votes
2 answers

gtk in-app notifications API referece

I've recently studied the gtk design patterns, and found the in-app notifications. There is an description on when to use it, but no reference to the gtk api. I have searched for it, but found just the GNotification and…
microo8
  • 3,568
  • 5
  • 37
  • 67
7
votes
1 answer

Gtk 3 position attribute on insert-text signal from Gtk.Entry is always 0

I am having trouble in managing the insert-text signal emitted by the Gtk.Entry widget. Consider the following example: from gi.repository import Gtk def on_insert_text(entry, new_text, new_text_length, position): print(position) entry =…
R. Cruz
  • 181
  • 8
7
votes
2 answers

using "try" to avoiding a segmentation fault

Recently in one of my programs I got a segmentation fault problem. I managed to find the line that its is causing the problem but I haven't find the way of fixing it. the line: self.window_player.add(self.vlc) where self.vlc is a widget and…
user3672754
7
votes
3 answers

Autocomplete for gtk3 and pygobject

I am looking for a possibility to add autocompletion for gtk3 libs to vim. I have already tried vim-jedi as it seems the state of the art autocompletion mechanism for vim and python (also recommended here), but that does not work for the gtk3 stuff…
flammi88
  • 381
  • 2
  • 14
7
votes
1 answer

What do I have to install to resolve Could not find any typelib for GtkSource, Cannot import: GtkSourceView, cannot import name GtkSource

I'm trying to apply a patch for meld from https://bugzilla.gnome.org/show_bug.cgi?id=680569 myself, and am having trouble with this: $ git clone git://git.gnome.org/meld $ cd meld $ python setup.py build $ bin/meld 2014-01-11 16:30:44,736 ERROR…
vorburger
  • 3,439
  • 32
  • 38
7
votes
1 answer

How to adjust the size of a GtkGrid cell?

I'm programming a little application in Python + Gtk3. I'm using a GtkGrid with one column and two rows. In the first row I put: a GtkScrolledWindow, and inside it a TreeView with two columns. In the second row I put: a ButtonBox, and inside it a…
skytux
  • 1,236
  • 2
  • 16
  • 19
7
votes
1 answer

How to show a png image in Gtk3 with Python?

First of all, it is important to mention that I'm learning Python and Gtk+ 3, so I'm not an advanced programmer in these languages. I'm trying to make a graphical interface in Gtk3 for a Python script that creates a png image, and I'd like to…
skytux
  • 1,236
  • 2
  • 16
  • 19
7
votes
1 answer

A sorted and filtered treemodel in Python Gtk+3..?

I am trying to get a treemodel (a liststore in fact) that can be filtered and also sorted. I have the following piece of code self.modelfilter = self.liststore.filter_new() self.modelfilter.set_visible_func(\ …
Vijay Murthy
  • 841
  • 2
  • 9
  • 19
7
votes
2 answers

Python and Gtk - which GTK version is being used?

from gi.repository import Gtk #print Gtk.GTK_MAJOR_VERSION win = Gtk.Window() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() That is my code, how can I know which version of Gtk is being used. Thank you!
David Gomes
  • 5,644
  • 16
  • 60
  • 103
7
votes
1 answer

Webkit threads with PyGObject on Gtk3

I am trying to load a webkit view on a different thread than main thread for gtk. I see the example PyGTK, Threads and WebKit I slightly modify for support PyGObject and GTK3: from gi.repository import Gtk from gi.repository import Gdk from…
shakaran
  • 10,612
  • 2
  • 29
  • 46