[pygtk] Threading in nautilus-python extensions

2009-07-04 Thread Jason Heeris
e any advice on this. Just some background: one of the previous maintainers for this project had the same problems[1], but I couldn't find any resolution. I asked a few days ago on the Nautilus Dev list[2], and I was directed here. Cheers, Jason Heeris [1] http://mail.gnome.org/archives/nau

Re: [pygtk] Threading in nautilus-python extensions

2009-07-16 Thread Jason Heeris
Just to follow up on this a bit, it really seems to be something to do with the nautilus-python extension specifically. One of the other NautilusSVN developers found that an extension written in C does not have the same problem at all: I've created a simple nautilus extension written in C tha

[pygtk] GIO: Monitor directory for changes recursively

2010-06-15 Thread Jason Heeris
Take the following demo code[1], which uses a GIO FileMonitor to monitor a directory for changes: import gio def directory_changed(monitor, file1, file2, evt_type): print "Changed:", file1, file2, evt_type gfile = gio.File(".") monitor = gfile.monitor_directory(gio.FILE_MONITO

[pygtk] gtk InfoBar documentation?

2010-06-27 Thread Jason Heeris
Is there any PyGTK documentation for the gtk.InfoBar widget? By the looks of it, it's a GTK 2.18 thing, and the PyGTK docs only go up to 2.17, so presumably that's why it's not there. At the moment I'm poring over the defs file, but is it available somewhere other than the usual place? — Jason ___

Re: [pygtk] gtk InfoBar documentation?

2010-06-28 Thread Jason Heeris
On 28 June 2010 15:27, Vermeersch Simon wrote: > You can try to use the GTK documentation at > http://library.gnome.org/devel/gtk/stable/GtkInfoBar.html Yeah, that's what I'm going on at the moment. Mainly it's the signals and properties that are important, so that's good enough. > It should loo

[pygtk] PyGTK 2.17 for Windows

2010-06-30 Thread Jason Heeris
binary installer for PyGI for Windows? A binary installer for PyGTK 2.17? Please keep me CCd on replies. Cheers, Jason Heeris PS. By the way, I usually work on a Debian Squeeze/Sid system, with PyGTK 2.17.0 (installed from Debian repo). I thought maybe I could take the 2.17 tarball and build it

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
On 1 July 2010 17:45, Tomeu Vizoso wrote: > Two options, not sure which would be easiest: > > - build pygobject <2.21.4 with --disable-pygi > - build pygobject 2.21.4 with --disable-introspection > (I'm assuming that you have a reason for not using a stable release of > PyGObject). What's the mi

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
On 1 July 2010 21:13, John Stowers wrote: > I have been generating the python installers for windows. Good work :) > This, and the fact that PyGtk has effectively been deprecated an > replaced with PyGI makes me nervous. ...I was not aware of that. I'll have to look into PyGI. > I will try to

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
So I decided to start this whole thing over, since I went down the wrong path before. I uninstalled pygtk, but kept pycairo 1.8.6 and pygobject 2.20.0. Then I brought up a mingw console and followed the win32 build instructions[1]. I get this error: $ python setup.py build --compiler=mingw32 --en

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
On 2 July 2010 10:54, Jason Heeris wrote: > AFAIK, this is part of pygtk... so do I need PyGTK already installed > to build a new PyGTK? Or have a missed something? No, apparently a reboot was required after uninstalling PyGTK (certain files were scheduled for removal that could

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-02 Thread Jason Heeris
On 2 July 2010 13:11, John Stowers wrote: > This looks like you are building from the master branch. Please build > from the windows branch. I should update the instructions to make that > clear. Yes! It works! For the benefit of anyone else reading this (or maybe for your updated instructions)..

[pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
Hi, I've been reading some conflicting advice on PyGTK and threading recently, probably because the API went through some fairly rapid changes recently. I'm a bit confused about the following points (consider them in context of PyGTK/PyGObject unstable, ie. 2.17/2.21 respectively): 1. If I wan

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 17:36, A.T.Hofkamp wrote: > Or you could drop threads entirely, and do your async activities using the > Twisted framework, designed for making asynchronous programs (where GTK > event handling is just one of the asynchronous sources). Please don't take this as a flame, but I've ha

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 18:05, Neil Benn wrote: > I persevered however and threads work fine in Python - OK the GIL can make > things a little more complicated but threading in Python is not much harder > to use then in Java or C# (in fact because of the GIL and single processor I > don't have to worry abo

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 21:48, A.T.Hofkamp wrote: > I was mostly triggered by the fact that you are doing asynchronous > activities next to the GTK application, which are apparently complicated > enough to use threads for. It's not complicated, there's simply a time consuming operation involved. > About

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 17:53, Pietro Battiston wrote: > Il giorno lun, 05/07/2010 alle 16.32 +0800, Jason Heeris ha scritto: >>   3. I don't need to do the threads_enter/leave (or use the context >> manager) if I only use glib.idle_add (or timeout_add, etc) > > No, you don&#

[pygtk] idle_add vs. threads_enter/threads_leave

2010-07-06 Thread Jason Heeris
Tim Evans wrote: > Something worth noting is that if you're targeting Windows then 2.a. is > your *only* option. In fact, gtk.gdk.threads_init() will freeze straight off, you don't need to wait for threads to start. > I would also point out that "whenever it next feels like it" is almost > always

[pygtk] idle_add vs. threads_enter/threads_leave

2010-07-06 Thread Jason Heeris
Antoine Martin wrote: > I don't know of any examples unfortunately and I must admit that I spent > quite a bit of time getting to grips with it, but in the end it is > remarkably simple (much more simple than I first thought too - so don't > let that put you off): > import gtk.gdk > gtk.gdk.threads

[pygtk] idle_add vs. threads_enter/threads_leave

2010-07-06 Thread Jason Heeris
Antoine Martin wrote: > It means that most of your code is not using threads at all, only the > bits that are *slow* Those are the only bits that use threads anyway. > I've lost track of your particular issue though, so maybe this is not > suitable for your use-case? How much slow work do you do

[pygtk] idle_add vs. threads_enter/threads_leave

2010-07-06 Thread Jason Heeris
Tim Evans wrote: > GTK+ 2.14.4 > PyGObject 2.14.2 > PyGTK 2.12.1 Mine is GTK+ 2.20 PyGObject 2.21.2 PyGTK 2.17.1 A few things about your changes confused me - 1. You call glib.idle_add, but never called glib.threads_init - won't this break on Linux? 2. You use BOTH gtk.gdk.lock and glib.idle_ad

[pygtk] What is "gobject.TYPE_BOXED"?

2010-07-07 Thread Jason Heeris
Looking through the PyGTK gobject type constants[1], I noticed the gobject.TYPE_BOXED constant. What is it, exactly? Does it have a use in Python not already filled by simply using PYOBJECT? — Jason [1] http://library.gnome.org/devel/pygobject/stable/gobject-constants.html#gobject-type-constants

[pygtk] FileChooserButton forgets changed file

2010-07-08 Thread Jason Heeris
Consider the attached program. Try this: 1. Select a file that is in a directory *with at least one other file* 2. Click "Check" to verify the path 3. Open the file in a text editor, modify it and save it 4. Click "Check" again When I try this, the path has changed! Have I done something wrong, o

[pygtk] FileChooserButton forgets changed file

2010-07-11 Thread Jason Heeris
> I couldn't reproduce what you're seeing unless I'm doing something wrong, > which is likely. Basically, run the script, select a file, click "Check". Keep the app open, but change the contents of the selected file and save it. Keep clicking "check" and the file name has changed to another one i

Re: [pygtk] FileChooserButton forgets changed file

2010-07-12 Thread Jason Heeris
On 12 July 2010 16:39, Pietro Battiston wrote: > I can reproduce this (Debian, 2.17.0 too)... > > And I can't see any explanation but "it's a bug". Great, just wanted to check I wasn't doing something wrong. Filed a bug: https://bugzilla.gnome.org/show_bug.cgi?id=624136 — Jason

[pygtk] A recursive directory monitor

2010-09-01 Thread Jason Heeris
I'm attempting to implement a recursive directory monitor. My approach is basically to take the gio.FileMonitor returned by the method gio.File.monitor_directory(), connect to the "changed" signal, and add or remove monitors on create/delete events for subdirectories. The problem I'm having is in

Re: [pygtk] A recursive directory monitor

2010-09-01 Thread Jason Heeris
On 1 September 2010 18:39, Jason Heeris wrote: > The latter approach isn't actually a bad idea, although it involves the > extra typical GObject boilerplate... > Actually, the other problem with that approach is that I don't get to use the underlying properties and notifica

[pygtk] List admin - info on mpsupport emails

2010-09-07 Thread Jason Heeris
Hi, Sorry for the noise, but could a PyGTK list admin please get in touch with me privately regarding the mpsupport.com bounces? Cheers, Jason ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: htt

[pygtk] Point of __gproperties__ "default" argument?

2010-09-22 Thread Jason Heeris
Consider the class given in the "Sub-classing GObject" tutorial[1]. What is the point of the default value for 'fuel' on line 12? Given that any access needs to go through the `do_get_property()` method anyway, which will need to work out what to return from the state of the object, I don't see how

[pygtk] Tweaking GTK InfoBar properties

2011-02-08 Thread Jason Heeris
I have a GTK InfoBar that I'd like to show a fixed width message in, but I can't figure out how to get at the contained text display widget ("get_content_area()" just gives me an HBox, and I'm not crazy about hard-coding indices of undocumented components into my app). Is there are robust way to d

[pygtk] GIO async operations

2011-02-21 Thread Jason Heeris
I'm confused about some of the GIO async functions. In my case, I want to use gio.File.replace_contents_async(). But what's the signature of the callback it takes? I would assume that the callback receives the original File object, but looking at the docs for gio.AsyncResult, it might also need to

Re: [pygtk] GIO async operations

2011-02-22 Thread Jason Heeris
On 22 February 2011 19:53, Christian Becke wrote: > Sorry, misread your message. The object is actually both: passed as an > argument to the callback, and accessible through the gio.AsyncResult by > calling its get_source_object method, see code below: Right, I did wonder about the redundancy, bu

Re: [pygtk] Label & Word Wrapping

2011-02-22 Thread Jason Heeris
On 22 February 2011 20:30, Adam Tauno Williams wrote: > available space - just wrap incorrectly.  Any hints for displaying > multi-lined / long-lined text in a label more elegantly? I think I've had the same problem. You may be interested in this: http://stackoverflow.com/questions/1893748/pygtk

[pygtk] Cannot shrink width of scrolled textview

2011-03-02 Thread Jason Heeris
In the attached code, a word-wrapping TextView is placed inside a ScrolledWindow which has a vertical scrollbar policy of "automatic". The problem is that if the width of the window is increased to a point where the scrollbar disappears, it cannot be shrunk again. The problem goes away if the vert

Re: [pygtk] Cannot shrink width of scrolled textview

2011-03-02 Thread Jason Heeris
On 3 March 2011 14:46, burebista wrote: > Set "sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)" the > automatic policy for both scrollbars. > > But I don't want a horizontal scrollbar... — Jason ___ pygtk mailing list pygtk@daa.com.au http:

[pygtk] SVG support in PyGTK on Windows

2011-03-08 Thread Jason Heeris
I've read through a previous thread on this list about SVG support under Windows[1], but it hasn't shed any light on my problem. Under Windows (XP), when I try to load SVG graphics in my PyGTK (+Twisted) app, eg. using self.root.set_icon_from_file(logo_path), I get: Traceback (most recent

Re: [pygtk] SVG support in PyGTK on Windows

2011-03-09 Thread Jason Heeris
On 9 March 2011 16:17, Dieter Verfaillie wrote: > Other than updating GTK+ to 2.20.1 you could also try the PyGTK All-in-one > installer: http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/. > See https://github.com/dieterv/pygtk-installer#readme for more info. This fixed everything! Kudos

[pygtk] Recent changes to the PyGTK Reference Manual

2011-04-10 Thread Jason Heeris
I'd like to offer some criticism of the new format of the "PyGTK 2.0 Reference Manual" at http://developer.gnome.org/pygtk/stable/ I use this reference all the time, but the recent changes make it extremely difficult to use — primarily the fact that the table of contents (which is to me the most i

Re: [pygtk] Recent changes to the PyGTK Reference Manual

2011-04-11 Thread Jason Heeris
On 11 April 2011 23:44, F Wolff wrote: > I think you can maybe offer your help at this bug: > https://bugzilla.gnome.org/show_bug.cgi?id=647047 Hmm, I think they've already said what I said. I'll keep my eye on it. Having said that, if I wanted to contribute, what would I submit a patch against?

[pygtk] Putting a link inside a label

2011-04-13 Thread Jason Heeris
I have a label (actually a WrapLabel[1]) containing some warning text. I'd like for a couple of the words of the text to take on the appearance of a hyperlink which, when clicked, activate another widget in the app (a notebook tab). I can't figure out how to do this — I've looked at the LinkButton

[pygtk] Inconsistent format for "path" in TreeView callbacks

2011-05-06 Thread Jason Heeris
Say I have a TreeView with a CellRendererToggle in one of the columns. If I double-click on a row, it will emit a 'row-activated' signal, passing the path as one of the parameters. If I select one of the CellRendererToggle checkboxes, it will emit a 'toggled' signal, also passing the path as one of

Re: [pygtk] Inconsistent format for "path" in TreeView callbacks

2011-05-06 Thread Jason Heeris
On 6 May 2011 18:53, Neil Muller wrote: > a) why do you want to convert between the two? In my experience, when > I start thinking about equating or manipulating paths, it usually > means I'm actually trying to test something about the underlying model > and should be converting to a TreeIter inst

Re: [pygtk] Inconsistent format for "path" in TreeView callbacks

2011-05-06 Thread Jason Heeris
On 7 May 2011 02:30, Neil Muller wrote: > Are you writing your own TreeModel (using GenericTreeModel) or using > something like TreeStore? Using a ListStore. > I think you really should be using TreeIters rather than paths to > manage this mapping, since they directly map to rows in the model, >

Re: [pygtk] Inconsistent format for "path" in TreeView callbacks

2011-05-06 Thread Jason Heeris
On 7 May 2011 02:50, Neil Muller wrote: > What are you storing in the list store if a row reference doesn't > allow you to easily get back to the object you want? I have an object that refers to a numpy array of several hundred data points, and a few fit parameters and flags. I append the fit par

[pygtk] Simplifying what's stored in a ListStore (was Re: Inconsistent format for "path" in TreeView callbacks)

2011-05-06 Thread Jason Heeris
On 7 May 2011 03:24, Neil Muller wrote: > On 6 May 2011 21:07, Jason Heeris wrote: > Storing the object in a hidden column is fine, and what I assumed you > were doing originally. Hah! Okay then, now that it's morning, I can't believe that didn't occur to me :P While w

Re: [pygtk] Simplifying what's stored in a ListStore (was Re: Inconsistent format for "path" in TreeView callbacks)

2011-05-08 Thread Jason Heeris
On 7 May 2011 15:55, Neil Muller wrote: > You can do via TreeViewColumn.set_cell_data_func and calling > set_property on the cell renderers. This approach has cleaned up my code somewhat, but there's one snag I've hit. The object with the properties I'm showing in the table is a subclass of GObje

Re: [pygtk] Simplifying what's stored in a ListStore (was Re: Inconsistent format for "path" in TreeView callbacks)

2011-05-10 Thread Jason Heeris
On 9 May 2011 19:25, Alessandro Dentella wrote: >> Is there a way to tell the CellRenderer to redraw, or recheck? > > sure. Emitting a row-changed will trigger a redraw: > >   model.emit('row-changed', path, iter) Presumably I trigger this by calling gtk.TreeModel.row_changed(path, iter) — but wh

[pygtk] Bundling GTK resources with py2exe

2011-10-24 Thread Jason Heeris
I'm using Python 2.6 and PyGTK 2.22.6 from the all-in-one installer on Windows XP. I'm slowly making progress building a single-file executable (via py2exe) for my app, and I've gotten to the point where I need to know more about bundling up the GTK resources. Specifically, when I run my app as no

Re: [pygtk] Bundling GTK resources with py2exe

2011-10-25 Thread Jason Heeris
On 25 October 2011 23:52, Joel Rivera wrote: > but a last step is that you need to package all of > those files to a single installer, I use `Inno setup` for that matter, > this is my working setup file 'setup.iss', which I just need to build it > from `Inno setup`. Oh, I meant to ask: is this t

Re: [pygtk] Bundling GTK resources with py2exe

2011-10-25 Thread Jason Heeris
On 26 October 2011 09:07, Joel Rivera wrote: > of your software, if that is not what you want, just copy the dist directory > and create manually the shortcuts if you will. I read somewhere that it's possible to get Inno (or NSIS?) to extract the files to a temp dir (instead of installing) and ru

[pygtk] Mapping stock icon names to files

2011-10-25 Thread Jason Heeris
I'm building an app using PyGTK 2.22.4 and Python 2.6, and bundling it up using py2exe. One of the big problems I'm facing is size, though. I can strip out translations, etc and other extraneous files (extraneous, that is, for my very well constrained deployment environment!). What I'm looking at