pygtk

Python + webkit + gtk on windows

情到浓时终转凉″ 提交于 2019-11-29 14:12:54
问题 I am trying to do this script: PY WYSIWYG And it says I need Gtk and WebKit. I think this is what I need: Gtk WebKit So I downloaded WebKit but I got a folder instead of an installer or install information. Do I move it into the python folder or what do I do? 回答1: You need PyGTK, here is a link to the download page with install instructions for Windows: http://www.pygtk.org/downloads.html You also need the Python bindings for Webkit, not just Webkit itself. Here is a link to an unofficial

Struggling to install pygtk with pip

橙三吉。 提交于 2019-11-29 12:25:06
I am trying to install pygtk using pip on Windows. Initially i get an error saying "ERROR: Could not import dsextras module: Make sure you have installed pygobject." So when I try installing pygobject I get an error saying "ERROR: Could not find pkg-config: please check your PATH environment variable" Pretty new to Python so could be making a stupid mistake but does anyone have any ideas? Thanks I had the same problem on my Window 7 machine, and solved it by installing the prebuilt PyGTK executables, which I found here: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/ . I installed

Run a function every X minutes - Python

て烟熏妆下的殇ゞ 提交于 2019-11-29 12:23:31
问题 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): time1 = time.time() readserial() # Read data from serial port processing() # Do stuff with serial data, including dumping it to a file time2 = time.time()

Is this possible to draw GtkTreeView listed like GtkIconView?

余生长醉 提交于 2019-11-29 11:59:33
I am working on a GTK+ application written in python. I obviously use PyGtk. My application is about collections of videos. It's a kind of F-spot or Picasa, but for video. As you can see in these two apps, you have a central area where you can see all of your photos with tag thumbnails under. In my app, I want to implement the same kinf of view. For now I simply use this: A gtk.Table containing a VBox , inside the VBox a Pixbuf (my video thumbnail) and a HBox , and inside the HBox , as many Pixbuf as tags. It's working but it's ugly and It seems like It's not the better solution. Looking

separate threads in pygtk application

那年仲夏 提交于 2019-11-29 11:05:05
I'm having some problems threading my pyGTK application. I give the thread some time to complete its task, if there is a problem I just continue anyway but warn the user. However once I continue, this thread stops until gtk.main_quit is called. This is confusing me. The relevant code: class MTP_Connection(threading.Thread): def __init__(self, HOME_DIR, username): self.filename = HOME_DIR + "mtp-dump_" + username threading.Thread.__init__(self) def run(self): #test run for i in range(1, 10): time.sleep(1) print i .......................... start_time = time.time() conn = MTP_Connection(self

gtk treeview: place image buttons on rows

亡梦爱人 提交于 2019-11-29 10:36:37
For each row in my treeview, I want 4 image buttons next to each other. They will act like radio buttons, with only one being activateable at a time. Each button has an 'on' and 'off' image. How do I do this? I figured out how to put images there, and how to put togglebuttons, but this seems to require some more effort as there is no pre-built cellrenderer that does what I want. Basically what'd solve my problem is figuring out how to make an image in a gtk.treeview clickable. any ideas? Have a look at this ' http://www.daa.com.au/pipermail/pygtk/2010-March/018355.html '. It shows you how to

PyGTK: dynamic label wrapping

核能气质少年 提交于 2019-11-29 06:45:12
It's a known bug/issue that a label in GTK will not dynamically resize when the parent changes. It's one of those really annoying small details, and I want to hack around it if possible. I followed the approach at 16 software , but as per the disclaimer you cannot then resize it smaller. So I attempted a trick mentioned in one of the comments (the set_size_request call in the signal callback), but this results in some sort of infinite loop (try it and see). Does anyone have any other ideas? (You can't block the signal just for the duration of the call, since as the print statements seem to

How to draw any GTK widget on top of Cairo surface

末鹿安然 提交于 2019-11-29 06:11:30
I would like to save the looks of a GTK window, and all the buttons and other widgets it contains to a PNG or PDF file. Cairo supports drawing on such surfaces. Could I somehow ask a GTK widget to draw itself on Cairo surface? A code sample would be much appreciated, since I am a newcomer to both GTK and Cairo. Python is my language of choice. In C, you can put your buttons and widgets in a GtkOffscreenWindow using gtk_widget_reparent() and then use gtk_offscreen_window_get_pixbuf() to render it onto a GdkPixbuf , which you can then save to a file. Sorry I don't have any Python code, but I don

Stop pygtk GUI from locking up during long-running process

萝らか妹 提交于 2019-11-29 04:53:08
I have a process that will take a while (maybe a minute or two) to complete. When I call this from my pygtk GUI the window locks up (darkens and prevents user action) after about 10 seconds. I'd like to stop this from happening, but I'm not sure how. I thought multithreading would be the answer, but it doesn't seem to be working. I've tried two different methods I found online. First, I modified this FAQ to take a long running function. Secondly I tried using threading.Thread directly like in this answer , but that also locks up. My two samples are below. I'm new to multithreading, so maybe it

Getting py2exe to work with zope.interface

泄露秘密 提交于 2019-11-29 04:51:23
I have a Python app based on Twisted and PyGTK. Twisted itself depends on zope.interface, and I don't import it directly. Unfortunately, when I try to run my app, the following error ends up in the error log: Traceback (most recent call last): File "tasks.py", line 4, in <module> File "ui\__init__.pyc", line 14, in <module> File "twisted\python\log.pyc", line 17, in <module> ImportError: No module named zope.interface Traceback (most recent call last): File "tasks.py", line 4, in <module> File "ui\__init__.pyc", line 14, in <module> File "twisted\python\log.pyc", line 17, in <module>