Re: [pygtk] Bundling GTK resources with py2exe

2011-10-25 Thread Jason Heeris
On 25 October 2011 23:52, Joel Rivera riv...@joel.mx 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

Re: [pygtk] Bundling GTK resources with py2exe

2011-10-25 Thread Jason Heeris
On 26 October 2011 09:07, Joel Rivera riv...@joel.mx 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

[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

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 san...@e-den.it 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,

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 drnlmuller+...@gmail.com 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

[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

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

2011-05-06 Thread Jason Heeris
On 6 May 2011 18:53, Neil Muller drnlmuller+...@gmail.com 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

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

2011-05-06 Thread Jason Heeris
On 7 May 2011 02:30, Neil Muller drnlmuller+...@gmail.com 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

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

2011-05-06 Thread Jason Heeris
On 7 May 2011 02:50, Neil Muller drnlmuller+...@gmail.com 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

[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 drnlmuller+...@gmail.com wrote: On 6 May 2011 21:07, Jason Heeris jason.hee...@gmail.com 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

[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

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

2011-04-11 Thread Jason Heeris
On 11 April 2011 23:44, F Wolff frie...@translate.org.za 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

[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

Re: [pygtk] SVG support in PyGTK on Windows

2011-03-09 Thread Jason Heeris
On 9 March 2011 16:17, Dieter Verfaillie diet...@optionexplicit.be 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

[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

[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

Re: [pygtk] Cannot shrink width of scrolled textview

2011-03-02 Thread Jason Heeris
On 3 March 2011 14:46, burebista blassme...@yahoo.com 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

Re: [pygtk] GIO async operations

2011-02-22 Thread Jason Heeris
On 22 February 2011 19:53, Christian Becke christianbe...@web.de 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

Re: [pygtk] Label Word Wrapping

2011-02-22 Thread Jason Heeris
On 22 February 2011 20:30, Adam Tauno Williams awill...@whitemice.org 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:

[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

[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 do

[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] 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:

[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 jason.hee...@gmail.com 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

[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 in the

[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, or

[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]

[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

[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_add

[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

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 17:36, A.T.Hofkamp a.t.hofk...@tue.nl 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

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 18:05, Neil Benn neil.b...@ziath.com 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

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 21:48, A.T.Hofkamp a.t.hofk...@tue.nl 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

Re: [pygtk] idle_add vs. threads_enter/threads_leave

2010-07-05 Thread Jason Heeris
On 5 July 2010 17:53, Pietro Battiston m...@pietrobattiston.it 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't. If you don't

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-02 Thread Jason Heeris
On 2 July 2010 13:11, John Stowers john.stowers.li...@gmail.com 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

[pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
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 somewhere in my home dir

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
On 1 July 2010 17:45, Tomeu Vizoso to...@sugarlabs.org 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).

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
On 1 July 2010 21:13, John Stowers john.stowers.li...@gmail.com 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

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

Re: [pygtk] PyGTK 2.17 for Windows

2010-07-01 Thread Jason Heeris
On 2 July 2010 10:54, Jason Heeris jason.hee...@gmail.com 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

Re: [pygtk] gtk InfoBar documentation?

2010-06-28 Thread Jason Heeris
On 28 June 2010 15:27, Vermeersch Simon simonvermeer...@gmail.com 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

[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

[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 =

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

[pygtk] Threading in nautilus-python extensions

2009-07-04 Thread Jason Heeris
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/nautilus-list/2006-December/msg00053.html [2] http