pygtk

ImportError: No module named _backend_gdk

醉酒当歌 提交于 2019-11-29 03:51:55
I am starting to get some insight into interactive plotting with python and matplotlib using pyGTK+. Therefore I took a look at the example given at the matplotlib website . This is a short exerpt of the Code: #!/usr/bin/env python """ Example of embedding matplotlib in an application and interacting with a treeview to store data. Double click on an entry to update plot data """ import pygtk pygtk.require('2.0') import gtk from gtk import gdk import matplotlib matplotlib.use('GTKAgg') # or 'GTK' from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas from numpy.random

Scale an image in GTK

夙愿已清 提交于 2019-11-29 03:18:23
In GTK, how can I scale an image? Right now I load images with PIL and scale them beforehand, but is there a way to do it with GTK? markuz Load the image from a file using gtk.gdk.Pixbuf for that: import gtk pixbuf = gtk.gdk.pixbuf_new_from_file('/path/to/the/image.png') then scale it: pixbuf = pixbuf.scale_simple(width, height, gtk.gdk.INTERP_BILINEAR) Then, if you want use it in a gtk.Image, crate the widget and set the image from the pixbuf. image = gtk.Image() image.set_from_pixbuf(pixbuf) Or maybe in a direct way: image = gtk.image_new_from_pixbuf(pixbuf) It might be more effective to

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

夙愿已清 提交于 2019-11-29 00:35:42
问题 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 up a dialog with a progress bar on it and I use a thread to do the process and to update the progress bar. This worked fine with PyGTK but after converting to PyGObject, I get all the usual improper threading weirdness: the program hangs, but it seems to hang in different parts of the process,

Progress bar not updating during operation

一曲冷凌霜 提交于 2019-11-28 21:59:01
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 i need to have a multi-threaded application to upload the file and simultaneously update the gui? or is there some other mistake that im making? Thanks in advance! I'm going to quote the PyGTK FAQ : You have created a progress bar inside a window, then you start

python pygtk windows 7 64 bit

最后都变了- 提交于 2019-11-28 20:56:00
I have been working with pygtk on linux for some time.I just want to make my app more distributable. Now I have used pygtk for 32 bit, but now I'd like to use pygtk for 64bit using pygtk 64bit. I have downloaded the all in one installer. I have changed my path as gtk would want and run the "pkg-config --cflags gtk+-2.0" command then ran the gtk-demo command and it did give me a demo and that works perfectly! Just I am missing someting because there in still no module named 'gtk' in my python gtk 64 bit. I want to make the 64 bit version of gtk work on windows and when I get a fix I want to

Where is PyGTK for Mac OS X?

隐身守侯 提交于 2019-11-28 17:49:26
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. b3rx I don't use macports but it seems that jhbuild works for me. Below is the steps that I've done. download gtk-osx-build-setup.sh from: https://raw.github.com/jralls/gtk-osx-build/master/gtk-osx-build-setup.sh and save it to your home directory. fire up terminal

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

≯℡__Kan透↙ 提交于 2019-11-28 17:46:00
问题 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 amenable to calling platform-specific functions. Ideally I'd like to call functions which have already been wrapped from Python, but if that's not possible, I'm not

Virtualenv on Ubuntu with no site-packages

淺唱寂寞╮ 提交于 2019-11-28 17:33:06
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) aware of specific modules that are located elsewhere on the system. What's the best way to do this? Or should I just suck it up and drop the --no-site-packages option? $ virtualenv --no-site-packages --python=/usr/bin/python2.6 myvirtualenv $ cd myvirtualenv $

Simple, versatile and re-usable entry dialog (sometimes referred to as input dialog) in PyGTK

若如初见. 提交于 2019-11-28 13:48:35
I am searching for a simple dialog with a text entry widget asking the user for some input. The dialog should be easy to run (like the gtk.MessageDialog variants) and as flexible. There are of course some examples but they are either not flexible enough or too complicated to construct for my taste. I hate re-inventing the wheel... or a dialog. Based on an example I found (thanks Ardoris !), I came up with a dialog subclass... hope it helps someone out there! #!/usr/bin/env python import gtk class EntryDialog(gtk.MessageDialog): def __init__(self, *args, **kwargs): ''' Creates a new EntryDialog

Cannot Import GST in Python

帅比萌擦擦* 提交于 2019-11-28 10:37:36
I'm in a quandary. I'm following the following tutorial (specifically, 6.4.2) http://majorsilence.com/pygtk_audio_and_video_playback_gstreamer I'm running Python 2.7, PyGTK 2.24, and GStreamer WinBuilds 10.7 (the main installer and the SDK). When I try and compile the program, I get the following error: Traceback (most recent call last): File "", line 1, in import gst File "C:\Program Files\OSSBuild\GStreamer\v0.10.6\lib\site-packages\gst-0.10\gst__init__.py", line 193, in from _gst import * ImportError: DLL load failed: The specified module could not be found. How do I get the gst module to