Questions tagged [pygi]

PyGI (Python GObject Introspection) is the replacement for PyGTK, compatible with GTK+3.x and the new GObject-Introspection technology.

Filter by
Sorted by
Tagged with
16 votes
5 answers
17k views

How to run asynchronous tasks in Python GObject Introspection apps

I'm writing a Python + GObject app that needs to read a non-trivial amount of data from disk upon start. The data is read synchronously and it takes about 10 seconds to finish the read operation, ...
David Planella's user avatar
9 votes
2 answers
3k views

PYGTK to PYGI: gtk.timeout_add equivalent

I have converted some Python code to use PYGI but I can't figure out how to convert this line: gtk.timeout_add(PING_FREQUENCY * 1000, self.doWork) To by clear, since I don't really know the ...
onBootQuestioner's user avatar
7 votes
1 answer
1k views

How do I add a Notebook to a Box in a VBox?

I have created an empty box in Glade to add a Notebook to. The reason I am not adding the actual Notebook in Glade is because I hear that you cannot add pages to a Notebook made in Glade. So, in ...
njallam's user avatar
  • 2,984
7 votes
3 answers
2k views

What package do I need to install to develop plugins for gedit?

I'm using Ubuntu 12.04 with python 2.7.3 and PyGObject and I'd like to develop plugins for Gedit in python. I found a simple looking tutorial for this sort of thing here. According to the tutorial, I ...
Wes's user avatar
  • 379
7 votes
1 answer
1k views

How to embed a GtkAboutDialog's content in a GtkNotebook widget

I'm writing a Python app that is tab-based, and I don't want it to have any additional pop-up dialogs. I'd like to use the Gtk.AboutDialog functionality, but I don't want it to appear as a separate ...
David Planella's user avatar
7 votes
1 answer
1k views

What are the design guidelines for appindicator icons?

I am creating a Unity AppIndicator using Python + PyGObject, but I wish for it's icon to be in standard Ubuntu style. Where can I find appropriate guidelines for using colours (or is it just white/...
Phlya's user avatar
  • 391
6 votes
2 answers
14k views

How to programmatically get a list of wireless SSIDs in range from NetworkManager

I'm writing a small little app that I want to submit to the Ubuntu App Review board, and one thing I'd like to do is for it to show the names of the detected Wireless SSIDs in a combo box. It's a PyGI ...
David Planella's user avatar
6 votes
2 answers
1k views

How to get rid of the background gradient of the inline GtkToolbar?

When you run the below code, it will show an inline toolbar in a window. Notice how the inline toolbar has a stand-out backbround. Is there a way to apply CSS to get rid of it and make blend with ...
Dima's user avatar
  • 9,817
6 votes
1 answer
8k views

How can I make my own custom desktop widgets?

A simple solution like HTML widgets and a transparent Webkit window would be ideal. I'm trying to make a simple background widget framework such that I can easily customize my desktop with some CSS ...
RobotHumans's user avatar
  • 29.5k
6 votes
2 answers
1k views

How can I programatically show/hide my app window with global shortcut key?

I'm writing a Notational Velocity clone for Gnome/Ubuntu using Quickly (PyGI) and I want to allow users to set a global shortcut key that will toggle the visibility of the app window when the app is ...
monotasker's user avatar
  • 3,675
5 votes
2 answers
2k views

Porting "import gobject" to use GObject-Introspection. (PyGTK to PyGI and GTK 3)

I've been trying to port a library from PyGTK to use GI and GTK3. The problem is I can't find any resources specific to the gobject imports, but only for GTK. I was hoping that if someone would ...
Jo-Erlend Schinstad's user avatar
5 votes
1 answer
2k views

Add dependency from ppa to package

I'am building simple dropdown terminal emulator application with PythonGI + GTK+3.0, I am using libkeybinder3.0 and gir1.2-keybinder3.0 packages for global keybinding these packages not available in ...
Özcan Esen's user avatar
5 votes
2 answers
621 views

How to rename an application while developing with Quickly

I've been developing an application using PyGI and Quickly, and I now need to rename it. Is there any quick way to change all of the app name references in a Quickly application, or will I just need ...
monotasker's user avatar
  • 3,675
5 votes
1 answer
6k views

How to draw on mouse click in Gtk.DrawingArea using pygi

I am writing a small application using PyGI which will interactively draw a line on a Gtk.DrawingArea between mouse clicks. But I am unable to figure out how to draw using the cairo context at the ...
csrins's user avatar
  • 53
5 votes
2 answers
3k views

How to dynamically resize GTK notebook pages

I've got a Python app that uses a Gtk.Notebook widget to display different pages. Each of these pages contain a different set of widgets, and I've noticed that the 'tallest' widget in terms of ...
David Planella's user avatar
5 votes
1 answer
768 views

Why does creating a new tab give me 'TypeError: Expected Gtk.Widget, but got GObjectMeta'?

def on_btn_new_subject_activate(self, widget): self.subjects.append_page(Gtk.TextView(), "Testing") I am trying to create a new tab on a text area but I whenever the signal is called by the event ...
njallam's user avatar
  • 2,984
4 votes
2 answers
2k views

How does a Python DBus session service know the user is logging out?

Say you have a DBus service on the session bus (the per-user bus). Your service might get started via an /etc/xdg/autostart/* file, or it might get started the first time some app tries to use your ...
jderose's user avatar
  • 659
4 votes
1 answer
321 views

Get child elements of a Notebook

I have a Notebook element and TextView elements inside them. Because the pages on the notebook will be constantly switched between. I need to be able to have in a variable the currently selected ...
njallam's user avatar
  • 2,984
4 votes
2 answers
231 views

Is there an ubuntu package for pygobject demos?

I know that there is a package for Pygtk demos (sudo apt-get install gtk2.0-examples) but I can't found an equivalent one for PyGObject.
eiro's user avatar
  • 89
4 votes
1 answer
432 views

PyGObject: Gio.File.copy_async() doesn't exist in Ubuntu 12.04

According to GIO Reference Manual Gio.File has a methode copy_async. In Ubuntu 12.04 I'm getting an AttributeError when I try to call this method. What should I use instead to for asynchronous ...
Florian Diesch's user avatar
4 votes
0 answers
388 views

Appindicator Icon Animation

I'm writing a software using pygobject for GTK+3 (Ubuntu 12.04, stable repo package versions for all dev tools) and I'd like my application to have animated AppIndicator icon. It's easy to make GLib....
Rostyslav Dzinko's user avatar
3 votes
2 answers
5k views

Change font programmatically for GTK3 TextView (quickly-widgets TextEditor)

In an app using PyGI and GTK3, I'm trying to let the user set the font family and size in a TextView through my app's settings dialog. In PyGI the TextView object has "set" methods for several ...
monotasker's user avatar
  • 3,675
3 votes
2 answers
2k views

Trying to create a GtkTreeView from Python, doesn't seem to work

I'm writing an app using Gtk/PyGI, and I need to create a sidebar with a Nautilus-like tree. However, Gtk refuses to cooperate with me. I tried both with Glade and GtkBuilder (creating the ...
Andy C.'s user avatar
  • 356
3 votes
1 answer
2k views

How to change menu entries in AppIndicator, when it is running?

There is a similar question at StackOverflow, but it didn't help me: Changing items while running. I tried asking at StackOverflow, but people there where not too active: How to change GTK menu in ...
Phlya's user avatar
  • 391
2 votes
1 answer
6k views

How to change Gtk.Notebook Tabs

There is a way to change the default Gtk.Notebook Tab? I want to realize a flat tab button
koMah's user avatar
  • 145
2 votes
1 answer
225 views

Glade: glib GError when trying to use object attributes [closed]

I'm using Ubuntu 14.10 but with the lubuntu desktop (LXDE) installed manually. I've designed my Python application's UI using Glade. Everything is working fine as long as I don't use attributes (<...
user4520's user avatar
  • 123
2 votes
1 answer
121 views

Is there a simple way with pygi to make an entire window a drop target for external input?

Example: Drop a file in a glade designed window and it triggers Handler.open_from_path(path)
RobotHumans's user avatar
  • 29.5k
2 votes
0 answers
244 views

Is using call_soon_threadsafe and GLib.idle_add together the correct way to safely call GTK code from asyncio, or is it overkill?

I have an application that runs in an asyncio event loop and I want to add a feature that interacts with my Gnome Shell, in particular sending a notification. Since GTK has its own (incompatible, I ...
nemec's user avatar
  • 171
2 votes
0 answers
1k views

How to install pygobject in python virtual env

I've created a python virtual env and I want to intall gi into it. But it returns this error to me. newtron@newtron:~/Documents/PythonProjects/PyQt/rasp-media$ ./bin/python3 -m pip install PyGObject ...
Newtron Malayalam's user avatar
2 votes
0 answers
952 views

How to solve old GLIB error while installing "pygobject" using jhbuild

I am trying to install pygobject using jhbuild. And I am getting this error: configure: error: Package requirements (glib-2.0 >= 2.48.0) were not met: Requested 'glib-2.0 >= 2.48.0' but version ...
Sameer's user avatar
  • 21
2 votes
0 answers
212 views

How can I dynamically add a widget that I can then fetch with a Gtk.Builder instance?

If I want to dynamically add a row to a vbox and populate it... I need a way to see if that row already exists. So the thought train is "Try to fetch the box with builder instance. If it fails, add ...
RobotHumans's user avatar
  • 29.5k
2 votes
0 answers
693 views

Why does Ubuntu's webkit inspector look (and work) just like Safari?

In older Ubuntu, the python-webkit inspector looked like Chrome, as you can see in these screenshots: https://stackoverflow.com/questions/13132459 (It had some annoying bugs, too.) I see Midori's ...
NoBugs's user avatar
  • 1,400
2 votes
1 answer
968 views

GObject (GTK3) TreeView: how can I activate row programmatically?

I've got a working TreeView with a ListStore as its model and selection set to SINGLE. How do I emit a signal to activate a specific row? I'm using PyGI. (Sorry if this is basic; it's not in the ...
monotasker's user avatar
  • 3,675
2 votes
0 answers
57 views

How should an OSD be coded with PyGI?

How is an OSD meant to be coded, using pygobject? Is it just an undecorated window that is application-paintable? Please provide all the details that you can (e.g. whether one has to use cairo, ...
Phoenix87's user avatar
  • 576
1 vote
2 answers
5k views

Nautilus gives a warning when opened in the current directory from the terminal [duplicate]

I have referred this link: How to open Nautilus at current command line directory? but ever since I upgraded to 17.10, running nautilus ., when I am already in a particular directory using cd in the ...
Kewal Shah's user avatar
  • 1,044
1 vote
2 answers
1k views

pygi how to toggle button without running function

I'm writing this application using quickly. I'm looking for a way to toggle button without running function which is connected to this button. def on_button_text_italic_toggled(self, widget): ...
Majster-pl's user avatar
1 vote
1 answer
586 views

How can I use pygi Webkit on a headless server install?

I have a set of scripts that works on my laptop that works fine as long as I'm booted in to an X session, but if I'm running on a headless server install I get loads of critical fails from Gtk. I'm ...
RobotHumans's user avatar
  • 29.5k
1 vote
1 answer
222 views

How to get Ubuntu AppIndicator icon coordinates

I'm working on Ubuntu Linux 12.04 and create software built on top of GTK+ 3 using pygobject. I've got a task of showing popup windows just below the app indicator icon of my application and I can't ...
Rostyslav Dzinko's user avatar
1 vote
1 answer
863 views

How update pygobject without breaking any dependency?

I want update the Pygobject of my system from the official repository. The last version on official repository is 3.16.1, but in the official package for Ubuntu is 3.12.0. I tried uninstall this ...
TheHX's user avatar
  • 13
1 vote
0 answers
121 views

Recommended way to check/fire alarm in Python (PyGI/PyGTK)

I am learning to develop an application by using Quickly (quickly create ubuntu-application). This application will stay in Application Indicator / Notification Bar and only work when a defined "alarm"...
fikr4n's user avatar
  • 1,255
1 vote
0 answers
64 views

How can I export a .ui file for a pygi window that I build dynamically?

I understand that building things with the MVC mindset is a good thing. I also understand that if you separate code maintenance and UI, that Glade UI files make it easier for non-programming people ...
RobotHumans's user avatar
  • 29.5k
0 votes
2 answers
599 views

Apply primary-toolbar background behind GtkEntry widget with GTK3

In PyGI (GTK3), how can I make a GtkEntry widget appear against the same background applied (by the user's theme) to the primary toolbar. I tried adding the same style class like this: entry....
monotasker's user avatar
  • 3,675
0 votes
1 answer
274 views

cool python cairo screen widget needs to be ported from PyGTK to PyGI

I am running Ubuntu 20.04 Mate Desktop. I found a cool old screen widget which shows clock, cpu, memory, Wi-Fi strength. It doesn't have any dependency to screenlet package. Though it's very old I ...
kenn's user avatar
  • 5,154
0 votes
1 answer
322 views

Quickly can't package, but raises no errors

I am trying to make a .deb package for my project in quickly. This is what I get: ilya@ilya-laptop:~/Projects/online-translator$ quickly package ...........Ubuntu packaging created in debian/ ...........
Phlya's user avatar
  • 391
0 votes
1 answer
146 views

Which packing constant to use for set_child_packing() in Python

I want to change a child of a box's padding; so I am using set_child_packing on the box holding the child. I can't figure out what to use as the constant for for the pack_type. Using PACK_START from ...
Vance T's user avatar
  • 165