pygtk

pygtk gui freezes with pyjack thread

Hello I have a program that records audio from firewire device (FA-66) with Jack connection. The interface is created with pygtk and the recording with py-jack (http://sourceforge.net/projects/py-jack/). The recording is done in a different thread because the GUI must be used at the same time for viewing results from the audio. The pro...

What is the fasted way to draw an image in Gtk+?

I have an image/pixbuf that I want to draw into a gtk.DrawingArea and refresh frequently, so the blitting operation has to be fast. Doing it the easy way: def __init__(self): self.drawing_area = gtk.DrawingArea() self.image = gtk.gdk.pixbuf_new_from_file("image.png") def area_expose_cb(self, area, event): self.drawing_area.window...

pygtk: How to set the height of pop-up window in gtk.EntryCompletion

I use gtk.EntryCompletion to implement the autocomletion function. But the list is so long that the pop-up window touches the bottom of screen. And I cant find the method of set the height of pop-up window in doc of pygtk. How to set the height of pop-up window in gtk.EntryCompletion? ...

Pixmap transparency in PyGTK

How can I create PyGTK pixmaps with one pixel value set to transparent? I know it has something to do with creating a pixmap of depth 1 and setting it as a mask, but all I find is that it either does nothing or totally erases my pixmap when drawn. At the moment, I make a pixmap with r = self.get_allocation() p1 = gtk.gdk.Pixmap(self.win...

pygtk loading a flow of image in only one pixbuf

Hello, I'm trying to embed a chartdrawer library that can only give me a bmp image in a buffer. I'm loading this image and have to explicitly call delete on the newly created pixbuf and then call the garbage collector. The drawing method is called each 50ms calling the garbage collector is realy CPU consuming. Is there a way to have...

Execution order with threads and PyGTK on Windows

I'm having issues with threads and PyGTK on Windows. According the the PyGTK FAQ (and my own experimentation), the only way to reliably update the GUI from a child thread is to use the gobject.idle_add function. However, it can't be guaranteed when this function will be called. How can I guarantee that the line following the gobject.i...

PHP desktop applications

Hi, I have quite a few years experience of developing PHP web applications, and have recently started to delve into Python as well. Recently I've been interested in getting into desktop applications as well, but have absolutely no experience in that area. I've seen very little written about PHP-gtk and wonder whether it's really a good ...

Pure python gui library?

Hello. Python has a lot of gui librarys: tknter, wxWidgets, pyGTK etc. But all this gui needs to be installed and quite heavyweight, so it's a bit complex to deploy end-user gui python apps that relay on mentioned gui librarys. Recently, i have thinked about python build-in ctypes. Theoretically, it's possible to create pure python gui...

clearing newline char from gtk.Textbuffer

I have a gtk.TextBuffer which is supposed to be cleared after pressing Enter, similar to the input box on most chat programs. I'm just setting the buffer back to a blank string. The newline character from Enter isn't removed though, and a blank line ends up above the cursor during the next input. Moving the cursor to the first gtk.Iter ...

Run a function every X minutes - Python

Hello. I'm using Python and PyGTK. I'm interested in running a certain function, which gets data from a serial port and saves it, every several minutes. Currently, I'm using the sleep() function in the time library. In order to be able to do processing, I have my system set up like this: import time waittime = 300 # 5 minutes while(1)...

How to handle back and forward buttons in the hildon.Seekbar?

The hildon.Seekbar widget consists of a scale widget and two buttons. What signals does the widget send when the buttons are clicked or how could I find out? Is there a way to monitor all signals/events that a widget sends in PyGTK? ...

What is the best widget for inputting time in PyGTK

I want the user to be able to input the duration for the application to be active. So my question is, what is the best widget or combination of widgets to allow the user to do this? ...

How to set default button in PyGTK?

I have very simple window where I have 2 buttons - one for cancel, one for apply. How to set the button for apply as default one? (When I press enter, "apply" button is pressed) However, I want to set focus to the first input widget (I can't use grab_focus() on the button) Any suggestions? Edit: After wuub's answer it works visually g...

Adding/removing notebook pages in PyGTK/GTK on the fly

How to refresh a notebook on the fly? I have an application which is supposed to have various number of pages according to the data in the underlying model. In order to synchronize the appearance of the Notebook I'd like to refresh it every time a row is added/deleted from the model. I've tried this: ... def get_pagebox(self, ...

Speeding up GTK tree view

I'm writing an application for the Maemo platform using pygtk and the rendering speed of the tree view seems to be a problem. Since the application is a media controller I'm using transition animations in the UI. These animations slide the controls into view when moving around the UI. The issue with the tree control is that it is slow. ...

Simple tray icon application using pygtk

I'm writing a webmail checker in python and I want it to just sit on the tray icon and warn me when there is a new email. Could anyone point me in the right direction as far as the gtk code? I already coded the bits necessary to check for new email but it's CLI right now. ...

gtk.StatusIcon and gtk.Menu on Windows

I have a crossplatform app that has a gtk.StatusIcon sitting in the tray, and a right click context menu. The problem is: on Windows machines the placement of the menu is awful. The top of the menu starts at the mouse pointer and so most of the menu extends below the bottom of the screen. This can then be scrolled up and is usable, but i...

Where is PyGTK for Mac OS X?

Is there a binary out there for the current mac os x, python for PyGTK? I work with multiple desktop environments (mac, windows, gnome) and really consider python's lack of cross platform GUI's a problem. Does anyone know where I can find a built version of PyGTK and GTK for Mac? I cant clone the git repository, it keeps timing out. ...

How do I add items to a gtk.ComboBox created through glade at runtime?

I'm using Glade 3 to create a GtkBuilder file for a PyGTK app I'm working on. It's for managing bandwidth, so I have a gtk.ComboBox for selecting the network interface to track. How do I add strings to the ComboBox at runtime? This is what I have so far: self.tracked_interface = builder.get_object("tracked_interface") self.iface_list...

How to change a GTK tree view style in Python?

I have an app written in python that presents some of its data in a tree view. By default, the tree view is a floaty white affair with little floaty triangles to expand the nodes. Is it possible to change this style to be more like a Windows explorer tree view? Specifically, I'd like to have vertical lines indicating parentage of the no...