pygtk

pyGame within a pyGTK application

What is the best way to use PyGame (SDL) within a PyGTK application? I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events. ...

Glade or no glade: What is the best way to use PyGtk?

Hello there. I've been learning python for a while now with some success. I even managed to create one or two (simple) programs using PyGtk + Glade. The thing is: I am not sure if the best way to use GTK with python is by building the interfaces using Glade. I was wondering if the more experienced ones among us (remember, I'm just a b...

What's the purpose of the GtkWidget.events property for (like) GtkTreeView widgets?

I have a Glade GUI description file with a GtkTreeView in a GtkHBox in a window; and there's a handler for the row_activated signal. Now, Glade has automatically set the "events" property (inherited from GtkWidget) of that treeview to some value (GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_...

How do I create a new signal in pygtk

I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object. ...

How do I develop and create a self-contained PyGTK application bundle for MacOS, with native-looking widgets?

I have read that it is possible to build GTK+ on MacOS X. I know that it's possible to create a bundle of a GTK+ application on MacOS. I also know that it's possible to create widgets that look sort of native. However, searching around I am not really clear on how to create a bundle that includes the native theme stuff, and uses Pytho...

Programmatically focusing a hippo.CanvasEntry?

Consider this Python program which uses PyGtk and Hippo Canvas to display a clickable text label. Clicking the text label replaces it with a Hippo CanvasEntry widget which contains the text of the label. import pygtk pygtk.require('2.0') import gtk, hippo def textClicked(text, event, row): input = hippo.CanvasEntry() input.set...

How do I coherently organize modules for a PyGTK desktop application?

I am working on a desktop application in PyGTK and seem to be bumping up against some limitations of my file organization. Thus far I've structured my project this way: application.py - holds the primary application class (most functional routines) gui.py - holds a loosely coupled GTK gui implementation. Handles signal callbacks, etc...

How can I determine the display idle time from Python in Windows, Linux, and MacOS?

I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer and able to observe notifications that pop up on the screen. I'd like to do this purely from (Py)GTK+, but I am amenabl...

Virtualenv on Ubuntu with no site-packages

I've been using virtualenv lately while developing in python. I like the idea of a segregated development environment using the --no-site-packages option, but doing this while developing a PyGTK app can be a bit tricky. The PyGTK modules are installed on Ubuntu by default, and I would like to make a virtualenv (with --no-site-packages) a...

How can I get a list of the running applications with GTK?

How can I get a list of the running applications? I'm referring to the ones in the panel at the bottom of the screen. ...

pygtk glade question: why isn't this simple script working?

I've been writing writing a small pygtk application using glade to put together the UIs. I've created several windows already that work, but for some reason this one isn't working. I get the following traceback: Traceback (most recent call last): File "test.py", line 7, in <module> class TestClass: File "test.py", line 10, in ...

How to handle a glade project with many windows

I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about 130KB, and will eventually have around 25 windows/dialogs and be around 200KB. Currently, I'm storing all the windows in one monolithic glade file. When I run a window I call it like... self.wTree = gtk.glade.XML("interface.glade", "WindowXYZ")...

How can I detect whether the alt/option key is down in GTK on Mac OS X?

I want to detect whether the alt/option key is pressed during a mouse drag in GTK on Mac OS X. I am using pygtk. Normally, holding down alt would add MOD1_MASK to event.state, but alt does affect event.state at all. In key press events alt shows up as gtk.keysyms.kana_switch, but this is not sufficient for my purposes since the user m...

pyGTK Radio Button Help

Alright, I'll preface this with the fact that I'm a GTK and Python newb, but I haven't been able to dig up the information I needed. Basically what I have is a list of Radio Buttons, and based on which one is checked, I need to connect a button to a different function. I tried creating all my radio buttons, and then creating a disgusting...

How to do pretty OSD in Python

Is there a library to do pretty on screen display with Python (mainly on Linux but preferably available on other OS too) ? I know there is python-osd but it uses libxosd which looks quite old. I would not call it pretty. Maybe a Python binding for libaosd. But I did not find any. ...

Which GTK widget combination?

I'm working with PyGTK, trying to come up with a combination of widgets that will do the following: Let me add an endless number of widgets in a column Provide a vertical scrollbar to get to the ones that run off the bottom Make the widgets' width adjust to fill available horizontal space when the window is resized Thanks - I'm new t...

Beginner-level Python threading problems

As someone new to GUI development in Python (with pyGTK), I've just started learning about threading. To test out my skills, I've written a simple little GTK interface with a start/stop button. The goal is that when it is clicked, a thread starts that quickly increments a number in the text box, while keeping the GUI responsive. I've go...

Progress bar not updating during operation

in my python program to upload a file to the internet, im using a GTK progress bar to show the upload progress. But the problems that im facing is that the progress bar does not show any activity until the upload is complete, and then it abruptly indicates upload complete. im using pycurl to make the http requests...my question is - do...

Finding the workspace size (screen size less the taskbar) using GTK

How do you create a main window that fills the entire desktop without covering (or being covered by) the task bar and without being maximized? I can find the entire screen size with and set the main window accordingly with this: window = gtk.Window() screen = window.get_screen() window.resize(screen.get_width(), screen.get_height()) b...

Disable pixmap background defined by GTK theme per application

For our (open source) fullscreen text editor we're changing background colors of gtk.Window, gtk.Fixed, etc. to custom colors. This works fine, but some GTK themes (e.g. Mac4Lin) define background pixmaps instead of background colors for some widgets. Those background pixmaps won't go away when calling modify_bg() methods of those widget...