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

Cannot import WebKit in python via gi.repository on Mac High Sierra

I have been trying to prepare a development where I can use GTK and WebKit in python for the past few days. I have given up on ubuntu and now I just want to focus on mac first. I have installed the pygobject3 and I can load the GTK 3.0. But I can't…
Sen
  • 43
  • 8
4
votes
2 answers

Install py3cairo for Python 3.6

I'm trying to get pygobject installed, but one of the dependencies is py3cairo. I've already installed it for use with Python 3.4, but now I want to use it with Python 3.6. I know I can install it with sudo apt-get install python3-cairo, but it…
bjd2385
  • 2,013
  • 4
  • 26
  • 47
4
votes
3 answers

How do I resize a Label's width?

I've been trying to resize a label's width for a while, but it seems IMPOSSIBLE, or at least incomprehensible for me... I'll explain my situation with images for the sake of clarity. This is how the Window looks with a "Normal" Label... This is…
PythonNoob
  • 235
  • 1
  • 2
  • 12
4
votes
2 answers

Tootip and signal of Gio.MenuItem

Below are two questions on the same component: Which signal is triggered when the mouse passes over a Gio.MenuItem? How to implement a tooltip for Gio.MenuItem?
Matheus Saraiva
  • 1,144
  • 1
  • 11
  • 33
4
votes
0 answers

Get the window handle in PyGI on MacOS

I use PyGObject/PyGI and GStreamer to show a video in my GUI. The video is shown in a Gtk.DrawingArea and therefore I need to get it's window-handle in the realize-signal-handler. On Linux I can simply use…
Biggie
  • 7,037
  • 10
  • 33
  • 42
4
votes
1 answer

Implementing GObject interfaces in Python

When using the Python 3 bindings of GTK3, is it possible to implement gobject.GInterface interfaces by subclassing them? In my specific case, I want to write a custom Gtk.TreeModel implementation. Is it sufficient to just subclass it and implement…
smheidrich
  • 4,063
  • 1
  • 17
  • 30
4
votes
1 answer

Gtk Popover Menu is not using the default padding

I created a GtkPopoverMenu and added some text buttons to it, but I can't get it to follow the same padding as other popovers, like the one in Nautilus. The default style classes are being applied, and GtkInspector shows the same padding values as…
user3474251
  • 209
  • 2
  • 12
4
votes
1 answer

PyGObject or PyGtk

I need to write a program on my Raspberry Pi to get a video and audio stream with Gstreamer from network and play them.(I have two stream. one for video and one for audio) and i need a custom GUI. I followed the below link…
user3397145
  • 787
  • 1
  • 5
  • 16
4
votes
2 answers

PyGObject and cx_freeze on Windows

I am trying to "freeze" a Python 3 file that uses PyGObject and Gdk/Gtk. Here is the Python script: from gi.repository import Gtk, Gdk class Handler: def onDeleteWindow(self, *args): Gtk.main_quit(*args) def searchPressed(self,…
Arc
  • 329
  • 3
  • 11
4
votes
1 answer

Get font color of the current GTK theme

I need to get the font color of the current theme. I found this question that explains it how to do it in C with gtk_style_lookup_color, but it seems that the function is deprecated. Making more researches I found the new function…
user3672754
4
votes
2 answers

Gtk has no attribute 'DIALOG_DESTROY_WITH_PARENT'

I am trying to create a working dialog box in Python 2.7/GTK+ 3 (PyGObject). I found an online tutorial which offered the following code... md = Gtk.MessageDialog(window, Gtk.DIALOG_DESTROY_WITH_PARENT, Gtk.MESSAGE_INFO, …
CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
4
votes
2 answers

Copy HTML to clipboard with PyGObject

I'd like to copy HTML (and a plain text equivalent) to the clipboard in a Linux GUI environment. Cross-platform is ideal, although Linux is my immediate target. I'd also like to use something that works in Python 3.x as well as 2.x. According to…
Craig McQueen
  • 41,871
  • 30
  • 130
  • 181
4
votes
3 answers

Error "Could not find any typelib for Gtk" with Python3 and GTK3

I cannot make Python3 work with GTK3. I'm in a cluster context and I had everything recompiled from the sources. When I run a simple example : from gi.repository import Gtk win = Gtk.Window() win.connect("delete-event",…
Michael Dussere
  • 498
  • 7
  • 25
4
votes
2 answers

How do I use g_settings_schema_get_key from python?

I'm following http://www.micahcarrick.com/gsettings-python-gnome-3.html to use GSettings from python, and I've succeeded to read a value: from gi.repository import…
AlexKing
  • 91
  • 6
4
votes
1 answer

Drag and drop file example in pygobject

I am trying to port sample drag and drop example from pygtk FAQ to pygobject. from gi.repository import Gtk as gtk import urllib import os TARGET_TYPE_URI_LIST = 80 dnd_list = [ ( 'text/uri-list', 0, TARGET_TYPE_URI_LIST ) ] def…
sarbjit
  • 3,786
  • 9
  • 38
  • 60