Questions tagged [pygobject]

GTK+ and other GObject bindings are provided by PyGObject through introspection.

pygobject
Filter by
Sorted by
Tagged with
62 votes
5 answers
37k views

pygobject-2.28.6 won't configure: No package 'gobject-introspection-1.0' found, how do I resolve?

I'm trying to get pygobject-2.28.6 to compile in cygwin (version in repository is 2.28.4 which has some issues). Here is the tail of ./configure: checking for GLIB - version >= 2.24.0... yes (...
Stupac's user avatar
  • 681
47 votes
2 answers
110k views

GtkDialog mapped without a transient parent

I have a GUI built in Glade (3.18) which is called by a Python 3 program (using PyGObject). I get a lot of warnings when running the program (Fedora 21) that say: Gtk-Message: GtkDialog mapped ...
tobias47n9e's user avatar
  • 2,223
43 votes
2 answers
22k views

What exactly are GLib and GObject?

I have been looking into the source code of python-mpdor and it mentions that it is gobject-based, for easy event handling (in the high-level client class). Can someone explain to me in simple ...
RanRag's user avatar
  • 49k
41 votes
4 answers
8k views

What's the recommended way to unittest Python GUI applications?

I'm currently foolish enough to try to maintaintain two parallel code bases for a Python desktop application, one using PyGObject introspection for GTK 3 and one using PyGTK for GTK 2. I work mainly ...
user avatar
41 votes
1 answer
2k views

How to create a letter spacing attribute with pycairo?

I'm using Pango + Cairo (through GObject) to render text with python3.7, and would like to set the letter spacing by creating an attribute and attaching that attribute to my pango layout. In the gnome ...
RasmusWL's user avatar
  • 1,573
29 votes
2 answers
9k views

PyCharm can not resolve PyGObject 3.0, but code runs fine

I'm using PyCharm 2.5 on Ubuntu 11.10, trying to develop an application using PyGObject 3.0 on Python 3.2.2. I've installed the Ubuntu package python3-gobject, and when I run my code, it works exactly ...
HOLOGRAPHICpizza's user avatar
27 votes
1 answer
4k views

Has threading in GTK w/ Python changed in PyGObject introspection?

I'm in the process of converting a program from PyGTK to PyGObject introspection for the first time and I've hit a roadblock with threading. I have a process that takes some time to complete, so I pop ...
user avatar
26 votes
5 answers
7k views

PyGObject GTK+ 3 - Documentation?

PyGObject appears to have no real documentation. This tutorial is as close as it gets. I've been struggling all morning simply trying to find a description of the arguments accepted by the Gtk.Window ...
HOLOGRAPHICpizza's user avatar
24 votes
3 answers
6k views

How to bind a text domain to a local folder for gettext under GTK3

With gettext you can either use the default system-wide locale directory, or specify one yourself using bindtextdomain. This is useful when running a program directly from source when the compiled .mo ...
Emilien's user avatar
  • 3,001
20 votes
1 answer
38k views

ValueError: Namespace Gtk not available

When following the instructions 2. Getting Started — Python GTK+ 3 Tutorial 3.4 documentation Tries In [6]: import gi ...: gi.require_version('Gtk', '3.0') ...: from gi.repository import Gtk ...
Wizard's user avatar
  • 20.9k
18 votes
1 answer
15k views

Can't import Webkit from gi.repository

When I try to import Webkit from gi.repository, it gives an ImportError: from gi.repository import Webkit ERROR:root:Could not find any typelib for Webkit Traceback (most recent call last): File "&...
Abhilash Nanda's user avatar
18 votes
3 answers
7k views

PyGObject in Python 3 on windows

Does anyone know if its possible to install PyGObject/Gtk+3 on windows for Python 3? I have found installers on gnome's website for Python 2 (here), and several statements that it works with Python 3 ...
aquavitae's user avatar
  • 18.2k
17 votes
2 answers
34k views

gi.repository Windows

I'm developing an app which has to be 100% compatible on windows and on linux. On linux I have no problems, but on windows I came up with this message: from gi.repository import Gtk ImportError: No ...
Yerko Antonio's user avatar
17 votes
1 answer
5k views

How to center a window with PyGObject

I'm currently trying to center my application window, but it seems to be impossible with PyGObject (GTK+ 3). Indeed, with pyGTK, I was doing it this way: window.set_position(gtk.WIN_POS_CENTER) So ...
gaetanm's user avatar
  • 1,394
17 votes
2 answers
770 views

Non-ASCII symbols in translation of GTK-GUI in Windows not working?

I have a small python program that shows how to do translations of GTK (pygobject) GUIs for Linux and Windows. Everything works in Linux, but in Windows non-ASCII symbols are not rendered in the ...
tobias47n9e's user avatar
  • 2,223
15 votes
4 answers
10k views

I'm completly confused with PyObject, PyGTK and GNOME 3 as well

I installed Fedora 15 to use Python3 and GObject to develop a desktop-application, because PyGTK looks outdated: PyGTK 2.24.0 released Friday 01 April 2011 by Rafael Villar Burke PyGTK 2.24.0 ...
quantez's user avatar
  • 191
14 votes
2 answers
4k views

How can I get the default colors in GTK?

Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get ...
JohnW's user avatar
  • 515
13 votes
5 answers
3k views

Gtk3 keys bindings in css files

Where can I find an exhaustive list of available keybindings that a user can define in a CSS file for GTK+ 3? I have already checked those resources: https://developer.gnome.org/gtk3/stable/...
cedlemo's user avatar
  • 3,264
13 votes
5 answers
29k views

ModuleNotFoundError: No module named 'gi'

I am trying to run the following program: import gi gi.require_version('Gst', '1.0') from gi.repository import GObject, Gst Bu I am getting: Traceback (most recent call last): File "...
Gabrielle's user avatar
  • 812
13 votes
2 answers
12k views

Python and d-bus: How to set up main loop?

I have a problem with python and dbus. I checked out the developer docs and specifications, but I don't understand how to set up a main loop. I want to listen for notification events. See http://dbus....
f4lco's user avatar
  • 3,754
13 votes
1 answer
1k views

Serialize Gtk TreeStore / ListStore using JSON

I made a new example which shows much better what I am trying to do. The new example gives the following ouput. Is there a way that the data can go into the respective store key (the {} brackets)? { ...
tobias47n9e's user avatar
  • 2,223
12 votes
2 answers
7k views

Use glade with pygobject Gtk3

I am converting a script to use Gtk3 using the migration guide (Porting GTK2 to GTK3). I converted my import pygtk to a from gi.repository import Gtk and so on... I'm stuck because the glade module ...
MP0's user avatar
  • 1,033
12 votes
5 answers
28k views

How do I install PyGTK / PyGobject on Windows with Python 2.6?

I have an application which depends on PyGTK, PyGobject, and PyCairo that I built to work on Linux. I want to port it over to windows, but when I execute import gobject I get this: Traceback (most ...
lfaraone's user avatar
  • 50.1k
12 votes
2 answers
9k views

Displaying PDF files with python3

I want to write a python3/PyGTK3 application that displays PDF files and I was not able to find a python package that allows me to do that. There is pypoppler, but it looks outdated (?) and does not ...
Fabian Henze's user avatar
12 votes
3 answers
4k views

Displaying an image with Pygobject and Python 3 from in-memory data

I have some RGBA data in Python 3 and I want to display the image it represents in a GTK3 window without using any extra libraries. First thing I tried was editing a Pixbuf's data as in an example (...
ikn's user avatar
  • 123
12 votes
1 answer
11k views

installing PyGObject via pip in virtualenv [duplicate]

I'm actually upgrading an old django app from python2.7 to python3.4. While installing pygobject via pip, I got this error: Collecting pygobject Using cached pygobject-2.28.3.tar.bz2 Complete ...
MicroCheapFx's user avatar
12 votes
2 answers
8k views

File msvc_recommended_pragmas.h missing while installing PyGObject via pip

I tried to install PyGObject via pip and it fails with given error: Building wheels for collected packages: pygobject Building wheel for pygobject (PEP 517) ... error ERROR: Command errored out with ...
Tr3nchHvlk's user avatar
11 votes
4 answers
32k views

Python cannot install PyGObject

I try install pygobject by pip pip install --user PyGObject but I doesn't work: Collecting PyGObject Using cached pygobject-2.28.3.tar.bz2 Complete output from command python setup.py ...
Newbie's user avatar
  • 445
11 votes
2 answers
6k views

Gtk.StatusIcon PopupMenu in python

im trying to port some small examples from PyGTK to the new PyGobject bindings, but ive hit a roadblock with a popupmenu, despite getting no errors, no menu is being shown on rightclick, here is the ...
Mike's user avatar
  • 400
11 votes
3 answers
6k views

How to get the background color of a widget in GTK and Python?

I want to get the normal background color of a widget (a GtkHeaderBar, in this case). I'm currently using style = self.get_titlebar().get_style_context() to get the style, and color = style....
user3474251's user avatar
10 votes
2 answers
13k views

How to draw a GdkPixbuf using GTK3 and PyGObject

I have a small application that uses a DrawingArea to draw a simple map using PyGObject and GTK3. I load a Pixbuf using from gi.repository import Gtk, GdkPixbuf pixbuf = GdkPixbuf.Pixbuf....
gnirx's user avatar
  • 197
10 votes
1 answer
6k views

GTK+ 3.0: How to use a Gtk.TreeStore with custom model items?

I'm trying to develop a GTK application in Python and I'm really stuck with the correct usage of a gtk.TreeStore. My main problem: I've already parsed some JSON and I have my own data structure which ...
f4lco's user avatar
  • 3,754
10 votes
1 answer
3k views

How to format the entries in Gtk.Entry

For example, the telephone format is +999 99 9999-9999. That is, the GtkEntry automatically add the characters (+,[space] and -) as the user types.
Matheus Saraiva's user avatar
10 votes
1 answer
8k views

Right Click Menu (context menu) using PyGTK

So I'm still fairly new to Python, and have been learning for a couple months, but one thing I'm trying to figure out is say you have a basic window... #!/usr/bin/env python import sys, os import ...
Michael Schwartz's user avatar
10 votes
3 answers
9k views

PyGObject on Windows

Over the last few days of headaches, I've found 3 possible methods to do this, all of which have issues. PyGObject's pip install fails due to a lack of Cairo and probably other dependencies. While ...
FierySwordswoman's user avatar
9 votes
1 answer
3k views

Load GUI from a Glade with GtkSourceView in PyGObject

I'm trying to use a Glade file that has a GtkSourceView widget in PyGObject. I've wrote a little guide on how to start using the new GtkSourceView 3.0 in Glade: http://cjenkins.wordpress.com/2012/05/...
Havok's user avatar
  • 5,844
9 votes
3 answers
881 views

What causes the different display behaviour for a GtkIconView between different GTK versions?

Pictures will explain the title: Under LMDE & Ubuntu 12.04 my GtkIconView looks like this - its correct in terms of the spacing between the icons: Under Ubuntu 12.10, 13.04 & Fedora 17 the ...
fossfreedom's user avatar
  • 3,023
9 votes
2 answers
2k views

How can I find out whether a GSettings schema exists or not before attempting to use it?

If a GSettings schema exists and has been compiled, there is usually no problem reading from it. However, if it doesn't exist, an error is usually thrown which cannot be handled. Try this in a ...
Mendhak's user avatar
  • 8,396
9 votes
1 answer
2k views

What is the non-deprecated way to display a stock icon in GTK3?

I'm assembling a GUI using PyGObject. This Python code works in context. I get a toolbar button with the stock "Open" icon. from gi.repository import Gtk # ... toolbar = Gtk.Toolbar() toolbar....
aaaantoine's user avatar
9 votes
1 answer
1k views

Terminate GObject.Mainloop() threads together with main

I have the following two threads: myThread = threading.Thread(target=sender.mainloop.run, daemon=True) myThread.start() myThread2 = threading.Thread(target=receiver.mainloop.run, daemon=True) ...
Zorgmorduk's user avatar
  • 1,345
9 votes
3 answers
20k views

Mysterious GObject warning: assertion `G_IS_OBJECT (object)' failed

I have a warning when I run my GTK (Python GObject introspection) application and I can't figure out its source. When the application is loading and I'm populating a GtkListStore, after the very first ...
user avatar
9 votes
2 answers
2k views

pango attributes with pygobject

I have the following code, that uses pygtk: attr = pango.AttrList() attr.change(pango.AttrSize(( 50 * window_height / 100) * 1000, 0, -1)) attr.change(pango.AttrFamily("Sans", 0, -1)) ...
Marco Biscaro's user avatar
9 votes
1 answer
833 views

cx_freeze PyGObject application on Linux

I have a simple PyGObject application: from gi.repository import Gtk class Window(Gtk.Window): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self....
Fenikso's user avatar
  • 9,321
8 votes
2 answers
4k views

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 ...
user avatar
8 votes
4 answers
2k views

Create python object from memory address (using gi.repository)

Sometimes I need to call a gtk/gobject function that only exists in C, but returns an object that has a python wrapper. Previously I used a solution based on ctypes that worked well: http://faq.pygtk....
jdm's user avatar
  • 9,770
8 votes
2 answers
6k views

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 ...
jduren's user avatar
  • 630
8 votes
2 answers
3k views

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 ...
microo8's user avatar
  • 3,824
8 votes
1 answer
5k views

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 ...
OdraEncoded's user avatar
  • 3,074
8 votes
3 answers
989 views

Introspection on pygtk3 possible?

One of the great things of python is the ability to have introspection on methods and functions. As an example, to get the function signature of math.log you can (in ipython) run this: In [1]: math....
xubuntix's user avatar
  • 2,333
8 votes
1 answer
2k views

"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 ...
Doom8890's user avatar
  • 445

1
2 3 4 5
17