[pygtk] How do I get the previous gtk.TreeIter in a TreeModel?
Hi, Hopefully I'm missing something obvious. Given a gtk.TreeIter in a gtk.TreeModel, from: http://www.pygtk.org/docs/pygtk/class-gtktreemodel.html#method-gtktreemodel--iter-next I can see how to get the gtk.TreeIter pointing to the next row. But how to I get a gtk.TreeIter pointing to the previous row? Just in case I'm taking the wrong approach here, what I want to do is move one (or more) selected rows, up one row. I was expecting the code for the callback for the "Move up one" button to be something like: def textMoveUpOneButtonClicked(self, widget): textSelection = self.getTextAttributesView.get_selection() [model, paths] = textSelection.get_selected_rows() for path in paths: iter = model.get_iter(path) prevIter = model.iter_prev(iter) model.swap(iter, prevIter) but there is no gtk.TreeMode.iter_prev() function. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] accessibility mystery
Hi Dusty, Any ideas why some apps are noticed and some are asleep? See: http://developer.gnome.org/projects/gap/guide/gad/ which is a little dated now. The key is in the following paragraph: The implementation for the GTK widgets is in a module called GAIL (GNOME Accessbility Implementation Library), which is dynamically loadable at runtime by a GTK application. Once loaded, those parts of your application that use standard GTK widgets will have a basic level of accessibility, without you having to modify your application at all. (If GAIL is not loaded, GTK widgets will have a default accessibility implementation that essentially returns no information, though it nominally conforms to the ATK API.) Applications which use Bonobo controls, particularly out-of-process ones, also load accessibility support code from module "libgail-gnome". Whether or not applications on the GNOME desktop automatically load these accessibility support libraries depends on the value of a gconf key, "/desktop/gnome/interface/accessibility"; a boolean value of "true" enables support for assistive technologies and applications which call gnome_program_init will automatically load the appropriate accessibility libraries at runtime. "Pure GTK+ applications", e.g. those that use gtk+ but do not link to libgnome, rely on the value of the GTK_MODULES environment variable, which must be set to "gail:atk-bridge" in order to enable assistive technology support. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] accessibility mystery
Hi Dusty, Thanks Rich, I think that's exactly the start I'm looking for. I notice it uses bonobo to access the registry, does this mean gnome must be running? Not the whole of GNOME. I've run AT-SPI programs under CDE, the other operating system that comes standard on Solaris, and they've worked fine. There is going to be a minimal set of applications/daemons that you will need to have running. at-spi-registry for one. bonobo-activation for another. To get the definitive set, I suggest asking on one of the GNOME accessibility mailing lists. Since I'm running firefox, I assume this means I have to enable "something else" to get the registry to recognize the applications available? We are working with firefox engineers to make sure that this fully understands AT-SPI as well. It's early days yet. When we finished, this should be just another application that accessibility software can "listen in on" and respond to. StarOffice/OpenOffice will be others. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] accessibility mystery
Dusty Phillips wrote: I guess that was all just a long-winded way of saying 'can somebody tell me how to write a pygtk program that can access existing gtk applications through their accessibility API?' Sorry for the wordiness. Check out: http://blogs.sun.com/roller/page/richb?entry=using_accessibility_to_generate_an ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Re: ANNOUNCE: GnomePython 2.12.1
Meir Kriheli wrote: You can also utilize the shell and pydoc, no need for a script, here's a bash one liner (the following should be on the same line, in case mail clients break it to 2): for i in gconf gnome gnome.ui gnome.ui gnomevfs bonobo bonobo.ui bonobo.activation; do pydoc $i > $i.txt; done You guys are great! Thankyou. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Re: ANNOUNCE: GnomePython 2.12.1
Johan Dahlin wrote: This is found as gtk.glade Thanks (and to Germán who also mentioned it). "import pygtk" External You also have: gtk.keysyms, gtk.gdk and gtk.compat (for some compatilibity with ancient versions) Not needed, only a wrapper for handling multiple installed versions. Note that some parts of the documentation still needs to be written, atk is completely missing for instance. Okay. What I don't seem to be able to find is the equivalent for PyORBIT or gnome-python. I've just downloaded the source tarball at: There's as far as I know no documentation for gnome-python or pyorbit. The easiest way to get a list of APIs is to write a script which goes through all the modules and introspects them (using dir/getattr/isinstance). Thanks. Germán can up with something else that I think will work nicely: > In python is possible to try: > > >>>import gconf > >>>help(gconf) I will also be able to do this for the PyGtk doc and bring it all into files in the architecture project case directory (thereby making a snapshot of the actual documentation). ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] Re: ANNOUNCE: GnomePython 2.12.1
Hi. We (Sun Microsystems) are in the process of integrating PyORBIT, PyGtk and gnome-python into our next major Solaris JDS (GNOME) release. One of the steps in order to achieve this is to get the project reviewed by an architectural review committee. The committee has a "20 questions" document. One of the questions is: 9.2 Interface Table: Include Imported and Exported Interface Tables showing all customer-visible interfaces and inter-project interfaces and significant internal interfaces (inter-subsystem and inter-invocation). Interfaces are not just function calls. Include user interfaces (graphical, browser based, character based), configuration files, XML schemas, network protocols, port numbers, etc. Now for Pygtk I can put something like: EXPORTED INTERFACES: Proposed Former Stability Interface StabilityClassification NameClassification or Other Comments - "import atk"External Pygtk imports [1] "import glade" External "import gtk"External "import gobject"External "import pango" External "import pygtk" External [1] PyGTK 2.0 Reference Manual http://www.pygtk.org/pygtk2reference/index.html This is because Pygtk has been extensively documented. What I don't seem to be able to find is the equivalent for PyORBIT or gnome-python. I've just downloaded the source tarball at: http://ftp.gnome.org/pub/GNOME/sources/gnome-python/2.12/ and this just seems to contain some examples and tests. The README is also a zero-length file. Could you point me in the right direction for the gnome-python (and PyORBIT) documentation please? Thanks. -- Rich Burridge Email: [EMAIL PROTECTED] Sun Microsystems Inc. (MPK14-260), Phone: +1.650.786.5188 4150 Network Circle,AIM/YAHOO: RicBurridge Santa Clara, CA 95054 Blog: http://blogs.sun.com/richb Original Message Subject: ANNOUNCE: GnomePython 2.12.1 Date: Mon, 03 Oct 2005 14:54:37 +0100 From: Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> To: PyGTK List CC: gnome-announce-list@gnome.org GnomePython 2.12.1 has been just released. This is a stable release for the GNOME 2.12 developer platform. GnomePython provides python interfacing modules for most of the GNOME Developer Platform libraries (except those already wrapped somewhere else.) Currently the list of provided python modules includes: - gnome, gnome.ui - gnomecanvas - gnomevfs - gconf - bonobo, bonobo.activation, bonobo.ui The source tarball can be found here: http://ftp.gnome.org/pub/GNOME/sources/gnome-python/2.12/ Please file bug reports (bugs, missing APIs) here: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-python Overview of Changes from gnome-python 2.12.0 to gnome-python 2.12.1 === * Fix compilation on Mac OS X ([EMAIL PROTECTED]) -- Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> The universe is always one step beyond logic ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] Highlighting all occurances of a string in a TextBuffer
John Finlay wrote: Looks OK to me except last line should be: start = matchEnd And I would create the tag in an initialization method. Thanks, I'll adjust accordingly. Are you sure that searchStr is in buffer? No it wasn't. In fact, nothing was in the text buffer. Here was the code I had: buffer = gtk.TextBuffer() highlightText(buffer, searchStr) buffer.set_text(results) self.result_view.set_buffer(buffer) A quick reordering of those lines fixed the problem. M u s t g e t m o r e s l e e p. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] Highlighting all occurances of a string in a TextBuffer
Hi all, I'm trying to write a function that will highlight all occurances of the string searchStr in the TextBuffer buffer. This is what I've currently got that doesn't work. def highlightText(buffer, searchStr): buffer.create_tag("red_foreground", foreground="red") start, end = buffer.get_bounds() finished = False while finished == False: res = start.forward_search(searchStr, gtk.TEXT_SEARCH_TEXT_ONLY) if not res: finished = True else: matchStart, matchEnd = res buffer.apply_tag_by_name("red_foreground", matchStart, matchEnd) start = matchStart What's happening is that: res = start.forward_search(searchStr, gtk.TEXT_SEARCH_TEXT_ONLY) is always returning None. Any clues to what I'm doing wrong would be appreciated, or a pointer to some other Pygtk code that does something similar. Thanks. -- Rich Burridge Email: [EMAIL PROTECTED] Sun Microsystems Inc. (MPK14-260), Phone: +1.650.786.5188 4150 Network Circle,AIM/YAHOO: RicBurridge Santa Clara, CA 95054 Blog: http://blogs.sun.com/richb ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/