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

Overriding virtual methods in PyGObject

I'm trying to implement the Heigh-for-width Geometry Management in GTK with Python for my custom Widget. My widget is a subclass from Gtk.DrawingArea and draws some parts of an Image. As I understood the GTK Docs (link above) I have to implement the…
thorink
  • 704
  • 1
  • 8
  • 21
6
votes
1 answer

Dialog breaks when using GtkBuilder to automatically connect signals, but works when manually connecting signals

I want to have a dialog window where some buttons close the dialog and others don't. The way I do this is by using the response signal from the Gtk.Dialog to call emit_stop_by_name('response') on the dialog. (If someone knows of a better way of…
dumbmatter
  • 9,351
  • 7
  • 41
  • 80
6
votes
1 answer

Python GTK+ Canvas

I'm currently learning GTK+ via PyGobject and need something like a canvas. I already searched the docs and found two widgets that seem likely to do the job: GtkDrawingArea and GtkLayout. I need a few basic functions like fillrect or drawline ... In…
lhk
  • 27,458
  • 30
  • 122
  • 201
6
votes
1 answer

Python. Doing some work on background with Gtk GUI

python 3.2.2 gtk3 3.2.2 python-gobject 3.0.2 I'm trying to display a GUI and do some work in the background. As I understand it should look something like this: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import time from threading import…
Atterratio
  • 445
  • 2
  • 9
  • 25
6
votes
1 answer

How to install PyGObject with Python 3 support

I've been trying to install PyGObject using a variety of methods. First, using apt-get but that only installs it for Python 2.x. Next I attempted to compile it myself but I have been having problems getting it to compile for Python 3. Does anyone…
AJ00200
  • 16,327
  • 7
  • 23
  • 21
6
votes
3 answers

How do you attach a popup menu to a column header button in GTK2 using PyGObject?

I want to popup a context menu when the user right-clicks on the header row of a Gtk.TreeView. In GTK3, Gtk.TreeViewColumn has a get_button() method, which makes this easy; simply attach the menu to the button and connect it to a 'clicked' event.…
user626998
6
votes
2 answers

Update a Gtk.ProgressBar from another thread or process

I have a GUI with a progressbar. It should show the progress of the work a second thread does. I would like to have something like an event the thread can send to the GUIs progressbar immediatly on each step of the work. But I don't see how this…
buhtz
  • 10,774
  • 18
  • 76
  • 149
6
votes
1 answer

Styling all GtkEntry widgets with CSS using Python3 PyGObject

I'm developing a GUI with PyGObject and am trying to style all the entry widgets. From this post I get the impression that I should be able to create a CSS style that would apply to all GtkEntry objects, but for some reason it's not working for me…
lefthander
  • 163
  • 1
  • 4
6
votes
1 answer

Cancel a Drag & Drop for some specific items in a Gtk.TreeView

I have a Gtk.TreeView here. Most but not all of the items should be able to be dragged & dropped. In this example the first item should not be able to be dragged & dropped but it should be selectable. How can I realize this? Maybe I have to use the…
buhtz
  • 10,774
  • 18
  • 76
  • 149
6
votes
0 answers

pyGObject installation error

I accidentally deleted 'pyGObject' package from python3.6 interpreter. After trying to reinstall I get the following error message. C:\WINDOWS\system32>pip install pygobject Collecting pygobject Using cached PyGObject-3.28.2.tar.gz Collecting…
Ishara Madhawa
  • 3,549
  • 5
  • 24
  • 42
6
votes
1 answer

How to get a working Progress Bar in python using multi-process or multi-threaded clients?

That's the basic idea. I couldn't understand them while reading about all this in python's documentation. There's simply too much of it to understand it. Could someone explain me how to get a working progress bar with a multi-threaded(or…
6
votes
1 answer

asyncio loop + GObject.MainLoop

I have coded something with an asyncio loop: loop = asyncio.get_event_loop() # bla coroutines loop.run_forever() and now, someone gives to me a part of code using a GObject.MainLoop() l = GObject.MainLoop() # functions using gi.repository I cannot…
C.H
  • 141
  • 1
  • 9
6
votes
1 answer

Set style property in PyGObject

I have a very simple PyGObject application: from gi.repository import Gtk, Gdk class Window(Gtk.Window): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.set_border_width(5) self.progress =…
Fenikso
  • 9,251
  • 5
  • 44
  • 72
6
votes
1 answer

What is a resource path that have to be used with gtk_builder_new_from_resource?

I understand the what are the arguments for the functions gtk_builder_new_from_file or gtk_builder_new_from_string but I struggle a little to see what is a resource path like: GtkBuilder * gtk_builder_new_from_resource (const gchar…
cedlemo
  • 3,205
  • 3
  • 32
  • 50
6
votes
0 answers

How to write a custom Gtk.CellRenderer which would show Gtk.ColorButton

I am using Python 3 and Gtk+ 3. I have a list of colors stored in a Gtk.ListStore. I want to display these colors as Gtk.ColorButton with a Gtk.CellRenderer so that the users would be able to view the colors and also change the colors too. My…
183.amir
  • 422
  • 3
  • 25