Re: [pygtk] Focus Cycling
On Tue, 1 Mar 2005 21:55:22 +0200 (SAST), Paul Malherbe <[EMAIL PROTECTED]> wrote: > What I am wanting to do is to disable the focus cycling facility of the > TAB key. I think you should connect a key_press_event signal to the main window self.win.connect("key_press_event", self.doKeyPress) and then create a function that will evaluate which key is being pressed, in case is the "Tab" key stop the emission, something like: def doKeyPress(self, widget, event): keyname = gtk.gdk.keyval_name(event.keyval) if keyname == 'Tab': self.win.stop_emission("key_press_event") I don't know if is the best solution, maybe someone else have a better idea. cheers gmt ___ 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] Focus Cycling
Hello I posted a similar query earlier but I think I phrased it badly. What I am wanting to do is to disable the focus cycling facility of the TAB key. I do realise that I can use the unset_flags option to disable focus on a widget but this also disables explicit focus on that widget. I would like to manually control the focus facility and therefore need to turn the TAB cycling facility off. Is this possible?? Thanks Paul ___ 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] codegen and const object args
Hello, I'm playing around with the code generator to create bindings for some GObject derived classes. Since I have some functions like I have a class called MiaVector3d and amongst others a method gfloat mia_vector3d_dot(const MiaVector3d *a, const MiaVector3d *b); In the original codegen complains about the second parameter with some "Cannot create method Vector3d.dot: 'const-MiaVector3d*' ArgType not found" (or so) error. Looking at the BoxedArg in argtypes.py, I was able to change the ObjectArg and the type registration in a way to create the wrapper, and it is working without (apparent) problems. My question: Is there a deeper reason, why const object arguments are not supported in the original codegen implementation? If not I would file a bug report and attach the patch there. Thanks in advance, Gert ___ 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] Flushing pending non-idle events
On Tue, 2005-03-01 at 16:49 +0100, Franck Pommereau wrote: > Hi all, > > Before to perform some long computation, I would like to commit all > the pending events (and in particular the one which changes the mouse > cursor to a clock), so I use: > > while gtk.events_pending() : > gtk.main_iteration(gtk.FALSE) > > Unfortunately, if I used gobject.idle_add before, those idle events > will be proceeded too and I'll never get out of this loop. Does > anybody has an idea of how to flush all events but stopping at the > first idle ones? I ran into the same issue once, but IIRC I worked around it. What I don't remember is if I did it by not iterating the pending events, or by avoiding the idle_add... :-/ -- Regards, -\- David Eriksson -/- SynCE - http://synce.sourceforge.net ScummVM - http://scummvm.sourceforge.net Desquirr - http://desquirr.sourceforge.net ___ 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] Flushing pending non-idle events
Hi all, Before to perform some long computation, I would like to commit all the pending events (and in particular the one which changes the mouse cursor to a clock), so I use: while gtk.events_pending() : gtk.main_iteration(gtk.FALSE) Unfortunately, if I used gobject.idle_add before, those idle events will be proceeded too and I'll never get out of this loop. Does anybody has an idea of how to flush all events but stopping at the first idle ones? Thanks in advance for your help. Franck ___ 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] [announce] gSmile 0.1.0 released
Hi everybody I'm so glad to announce the first public release of gSmile: gSmile 0.1.0 *gSmile* is an open-source emoticon manager, that is a nice piece of software that helps you to keep your emoticons and smilies organized and to find them quickly whenever you need one of them. It supports emoticon storing in nested folders with drag'n'drop from and towards the web-browser. gSmile is written in Python and uses this great wrapper, PyGTK, for the GTK+ toolkit. You can find all the information you need, the support forum, the mailing-list and some shots, too, on gSmile home page at http://gsmile.sourceforge.net/ This release is still an alpha development release: this because there aren't yet all the features I want for the first stable release, but gSmile now has enough features to be considered useful. Currently these features are present: - Folder create/delete/edit/move up/down - Emoticon storage (with drag'n'drop from the browser) - Emoticon usage (with drag'n'drop to the browser) - Window-behaviour preferences - Multiple tag-mode functionality (4 predefined, or write your own - no saving of custom ones) These are the tarballs: Source package: untar it and run `python setup.py install' gsmile-0.1.0.tar.gz md5sum: 56454ec7d5621dd29c4d514fe3b1ab0e http://prdownloads.sourceforge.net/gsmile/gsmile-0.1.0.tar.gz?download Binary package: untar it under / (the root directory), files will be placed in the right place gsmile-0.1.0.linux-i686.tar.gzmd5sum: 63cb988b988e1af5526b62780a063ac0 http://prdownloads.sourceforge.net/gsmile/gsmile-0.1.0.linux-i686.tar.gz?download Give it a try and report any bug you find, please. Thanks very much, Federico Pelloni ___ 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] get the XID from gtk.Drawingarea
Holger Reinmann wrote: Hello Folks, I want to write a small mplayer GUI in pygtk. The Gui contain a gtk.Drawingarea in that mplayer should display the video. For this I need the XID from the Drawingarea. How do i get this? I have read the tutorial and the reference very often but it don't work. I also read the mailing list. And found that other people has similar problems with version 1.99.X. But I'm using pygtk 2.4.1 and python 2.3 from debian unstable. You have to get the gtk.gdk.Window of your gtk.DrawingArea and read its "xid" attribute (provided by the gtk.gdk.Drawable ancestor: http://pygtk.org/pygtk2reference/class-gdkdrawable.html ). If you have problems getting the window that is probably due to it not being realized yet. You must get the window after it exists... until then the DrawingArea is created but not its associated gtk.gdk.Window so you properly get None. This dummy example works here: import pygtk pygtk.require('2.0') import gtk def show_xid(widget): widget.set_label("X window ID: %s" % (widget.window.xid,)) window = gtk.Window() vbox = gtk.VBox() da = gtk.DrawingArea() da.set_size_request(200,100) button = gtk.Button("Press me") button.connect("clicked", show_xid) vbox.pack_start(button) vbox.pack_start(da) window.add(vbox) window.set_title("DrawingArea example") window.connect("destroy", gtk.mainquit) window.show_all() gtk.main() Take care, Pachi ___ 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] Where is gnome-python?
On Tue, 2005-03-01 at 13:33 +, Gustavo J. A. M. Carneiro wrote: > On Tue, 2005-03-01 at 14:26 +0100, Murray Cumming wrote: > >On Mon, 2005-02-28 at 21:47 -0700, Elijah Newren wrote: > >> On Tue, 1 Mar 2005 01:31:31 -0300, Eric Jardim <[EMAIL PROTECTED]> wrote: > >> > Why does gnome-python and other specific bindings besides PyGTK do not > >> > appear on this page on the GNOME project? > >> > > >> > http://www.gnome.org/start/2.9/bindings/#python > >> > >> This appears to be an oversight, AFAICT. If anyone would like to make > >> a patch against > >> gnomeweb-wml/www.gnome.org/start/2.9/bindings/index.wml, we should be > >> able to get this straightened out. > > > >I have added that now. > > Thanks! > > BTW, the CVS modules are not correct. It should be gnome-python/pygtk > and gnome-python/gnome-python. Fixed. -- Murray Cumming [EMAIL PROTECTED] www.murrayc.com www.openismus.com ___ 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] Where is gnome-python?
On Tue, 2005-03-01 at 14:26 +0100, Murray Cumming wrote: >On Mon, 2005-02-28 at 21:47 -0700, Elijah Newren wrote: >> On Tue, 1 Mar 2005 01:31:31 -0300, Eric Jardim <[EMAIL PROTECTED]> wrote: >> > Why does gnome-python and other specific bindings besides PyGTK do not >> > appear on this page on the GNOME project? >> > >> > http://www.gnome.org/start/2.9/bindings/#python >> >> This appears to be an oversight, AFAICT. If anyone would like to make >> a patch against >> gnomeweb-wml/www.gnome.org/start/2.9/bindings/index.wml, we should be >> able to get this straightened out. > >I have added that now. Thanks! BTW, the CVS modules are not correct. It should be gnome-python/pygtk and gnome-python/gnome-python. > >Other bindings are not there because they are not on the release >schedule, usually because they do not follow the GNOME Platform Bindings >rules. > -- Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> The universe is always one step beyond logic. smime.p7s Description: S/MIME cryptographic signature ___ 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] Where is gnome-python?
On Mon, 2005-02-28 at 21:47 -0700, Elijah Newren wrote: > On Tue, 1 Mar 2005 01:31:31 -0300, Eric Jardim <[EMAIL PROTECTED]> wrote: > > Why does gnome-python and other specific bindings besides PyGTK do not > > appear on this page on the GNOME project? > > > > http://www.gnome.org/start/2.9/bindings/#python > > This appears to be an oversight, AFAICT. If anyone would like to make > a patch against > gnomeweb-wml/www.gnome.org/start/2.9/bindings/index.wml, we should be > able to get this straightened out. I have added that now. Other bindings are not there because they are not on the release schedule, usually because they do not follow the GNOME Platform Bindings rules. -- Murray Cumming [EMAIL PROTECTED] www.murrayc.com www.openismus.com ___ 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] Simple questions
Eric Jardim wrote: Hi, I am a little new to gtk+2.0 bindings to Python and I have a few questions. Context: I want to develop Free Software applications with the Gtk toolkit using the Python bindings. Not only this, I want to use some of its extensions like the Libglade, Gnome, the GnomeCanvas module and possibly the DiaCanvas. I know that all of this modules have python bindings, but some of them have no documentation to the API. 1. What are your sugestions for a new developer, that want to use the most new features of Gtk/Gnome libs with Python? What versions (2.x) you recomend. Latest stable 2.4 (note 2.6 will be released in a week or two) 2. Are all those projects (Gtk/Gnome/Libglade/GnomeCanvas/DiaCanvas) separate, so the developers don't interact? Python bindings? pygtk = gobject,atk,pango,gtk,libglade gnome-python = gnome,gnomecanvas etc diacanvas = separate the developers mostly know each other so the interact to some extent :) 3. Why is so hard to find API docs? Is there any easy way that I can generate it from the sources myself and use it? There's only documentation for gobject,gtk and gdk. 4. I am using Debian sid, and the package versions for (Gtk, Gnome) are (2.6.x, 2.8.x). But python bindings for them are versions (2.4.x, 2.6.x). Is that right? What are the right versions to use? What versions you sugest. If you can use 2.6 as I said. 5. Are there bindings to Libart? Well, I hope you understood my concerns, and if you have any tips, I will be very grateful. Not really, there are some very incomplete ones in gnome-python required by gnome-print. For vector drawing I strongly recommend cairo, which has python bindings. Johan ___ 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] get the XID from gtk.Drawingarea
Hello Folks, I want to write a small mplayer GUI in pygtk. The Gui contain a gtk.Drawingarea in that mplayer should display the video. For this I need the XID from the Drawingarea. How do i get this? I have read the tutorial and the reference very often but it don't work. I also read the mailing list. And found that other people has similar problems with version 1.99.X. But I'm using pygtk 2.4.1 and python 2.3 from debian unstable. Thanks greetings Holger Reinmann -- Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail ___ 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] When was gnomeprint.pango_create_context added to the API?
On Tue, 2005-03-01 at 06:50 -0500, Thomas Mills Hinkle wrote: >I have a user reporting the following error with my newest gnomeprint >implentation: >gnomeprint.pango_create_context(gnomeprint.pango_get_default_font_map()) >AttributeError: 'module' object has no attribute >'pango_create_context' > >I assume this error is a result of his using an older version of >gnomeprint that doesn't support pango_create_context. If so, I'd like >to implement a workaround for users like him (I'll have my app detect >the version and then give them my old not-pango-ified gnomeprint stuff >if they can't support the new). However, I wanted to confirm, if >possible, that this is in fact a versioning issue. So, can anyone >tell me: > >1. When was pango_create_context added to gnomeprint? Since gnome-python 2.6.0, _but_ inclusion of this API is conditional, depending on the availability of libgnomeprint-2.2 >= 2.7.2 installed on the system. So, I would say that this API is available in distributions including gnome-python 2.6.x and GNOME platform 2.8. >2. How would you suggest detecting the version of gnomeprint a user >has installed? Try using this expression to see if the API is there: hasattr(gnomeprint, "pango_create_context") Alternatively, you can: try: #... use new pango API except AttributeError: #... use old API Regards. -- Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> The universe is always one step beyond logic. smime.p7s Description: S/MIME cryptographic signature ___ 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] When was gnomeprint.pango_create_context added to the API?
I have a user reporting the following error with my newest gnomeprint implentation: gnomeprint.pango_create_context(gnomeprint.pango_get_default_font_map()) AttributeError: 'module' object has no attribute 'pango_create_context' I assume this error is a result of his using an older version of gnomeprint that doesn't support pango_create_context. If so, I'd like to implement a workaround for users like him (I'll have my app detect the version and then give them my old not-pango-ified gnomeprint stuff if they can't support the new). However, I wanted to confirm, if possible, that this is in fact a versioning issue. So, can anyone tell me: 1. When was pango_create_context added to gnomeprint? 2. How would you suggest detecting the version of gnomeprint a user has installed? Thanks in advance, Tom ___ 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] no invisible cursor
John Finlay wrote: Ionutz Borcoman wrote: Hi, The reference says: "To make the cursor invisible, use gtk.gdk.Cursor() to create a cursor with no pixels in it." When I try to use it, I get an error: >>> import gtk >>> gtk.pygtk_version (2, 4, 1) >>> c = gtk.gdk.Cursor() Traceback (most recent call last): File "", line 1, in ? TypeError: Usage: gtk.gdk.Cursor(cursor_type) gtk.gdk.Cursor(display, cursor_type) gtk.gdk.Cursor(display, pixbuf, x, y) gtk.gdk.Cusrsor(source, mask, fg, bg, x, y) >>> Any idea on what's wrong? Is this not supported in 2.4.1? Is it a bug? TIA, Try: pix = gtk.gdk.Pixmap(window, 1, 1, 1) color = gtk.gdk.Color() cursor = gtk.gdk.Cursor(pix, pix, color, color, 0, 0) John Thanks, it should probably work, but I've already changed my code to: def create_empty_cursor(): pix_data = """/* XPM */ static char * invisible_xpm[] = { "1 1 1 1", " c None", " "};""" color = gtk.gdk.Color() pix = gtk.gdk.pixmap_create_from_data(None, pix_data, 1, 1, 1, color, color) return gtk.gdk.Cursor(pix, pix, color, color, 0, 0) This way I don't need the window anymore and I can create the cursor before showing the widget (in my __init__). I guess this should go in the standard pygtk, that is, a call to gtk.gdk.Cursor() with no arguments should return this cursor. As I said before, I belive hiding the cursor is a common enough operation, so it should deserve a simpler solution. If not, your or my solution should go in the FAQ under "How do I hide the cursor?": How do I hide the cursor? - 1. Create an invisible cursor with: pix_data = """/* XPM */ static char * invisible_xpm[] = { "1 1 1 1", " c None", " "};""" color = gtk.gdk.Color() pix = gtk.gdk.pixmap_create_from_data(None, pix_data, 1, 1, 1, color, color) invisble_cursor = gtk.gdk.Cursor(pix, pix, color, color, 0, 0) 2. When you need to hide the cursor in 'some_gtk_widget', set it to the invisble one: some_gtk_widget.window.set_cursor(invisble_cursor) 3. To show again the cursor, set it to the old cursor or to the default one: # set the cursor to the default one some_gtk_widget.window.set_cursor(None) Cheers, -- Ionutz Borcoman http://borco.net/ signature.asc Description: OpenPGP digital signature ___ 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] PNG icons not rendering correctly
On Mon, Feb 28, 2005 at 12:06:08PM -0600, Gabriel Munoz wrote: > I'm experiencing a strange issue with some images I'm using for toolbar > icons. They aren't rendering correctly with some versions of gtk. > > Here is how it looks under Mnadrake-9.2: > http://blackhole.cs.uwec.edu/~munozga/images/gjots-2.1.1-icons_blurred.png Ok, I got to the bottom of this one after lots of testing across 4 distros. The above screen shot occurs with older versions of libglade. Specifically, I know libglade-2.3.6 to render some things incorrectly, while libglade-2.4.1 will render them just fine. Unfortunately, most current distros are running older versions of libglade so this bugs are still seen on many users desktops. Good thing is it is well-fixed upstream. ___ 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/