Re: [pygtk] gir1.2-nautilus-2.0
Yeah I too found that the difficult part: no documentation. I would suggest to have a look at the nullege website. I have been a couple of times successful finding examples there. Regards, Leon Timo timomli...@gmail.com wrote: On 26-06-11 17:19, Giuseppe Penone wrote: Hi, I've always used the good package python-nautilus for the python extensions, but now it seems that python-nautilus works with pygtk2 only. As I found out that between the gir1.2-* there's also a binding to nautilus, can anybody point me to a simple demo to understand how this binding work? (where to place the extension files and so on...) Your best bet will be the C manual for the Nautilus bindings. Well, I did/do so for all the bindings I use that use Gobject Introspection. Cheers, Timo Cheers. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Is there a gnome keyring api for PyGi?
Hi all, Is there a Gnome Keyring api for pygi? I tried something like this: from gi.repository import GnomeKeyring But I can't find the module to load. Does someone know if/how I can access the Gnome Keyring api with python gobject introspection? Or should I just use the static gnomekeyring? Regards, Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
That's really weird. I've reinstalled python-gobject and gir1.2-glib-2.0 but the problem persists and it also happens on my other pc. I also created a new user account locally because maybe it was some weird entry in my .bashrc or something but that didn't help either. There's also another weird issue. When I do from gi.reposityory import Gtk (and other modules too) I get this exception: http://paste.ubuntu.com/615673/ Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Timo [timomli...@gmail.com] Sent: Wednesday, June 01, 2011 09:13 To: pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() On 31-05-11 20:38, Leon Bogaert wrote: Hi Avi, Good guess :) I'm running Ubuntu 11.04 Weird, I'm running 11.04 as well, and I have no problems. No idea why it won't work for you though. Cheers, Timo leon@polly:~$ dpkg -l | grep gir | grep glib ii gir1.2-glib-2.0 0.10.7-0ubuntu1 Introspection data for GLib, GObject, Gio and GModule leon@polly:~$ ls -al /usr/lib/girepository-1.0/Gio-2.0.typelib -rw-r--r-- 1 root root 241632 2011-04-05 12:36 /usr/lib/girepository-1.0/Gio-2.0.typelib I've also tried running Gio.MountMountFlags.NONE on my other machine (also 11.04): same error. I've also got a Fedora 15 box and there it works! The package of gobject-introspection there is 0.10.8-1 Regards, Leon From: Avi Levy [avi...@gmail.com] Sent: Tuesday, May 31, 2011 19:26 To: Leon Bogaert Cc: John Stowers; pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() I can verify that John's instructions work on my system: Gio.MountMountFlags.NONE enum G_MOUNT_MOUNT_NONE of type GMountMountFlags It looks like you are running Linux, if possible what distro? For instance, I am running Ubuntu and the package containing gir bindings for gio is called gir1.0-glib-2.0 (0.9.3-0) the relevant file containing gio bindings is: /usr/lib/girepository-1.0/Gio-2.0.typelib It sounds like you may have an out-of-date typelib or something? ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
OK, I've fixed it. I did almost all the testing in ipython and it provided to be a bug in. ipython :S So I upgraded to 0.10.2 from the deb provided here and it worked! Thanks for all the help! Regards, Leon From: Leon Bogaert Sent: Wednesday, June 01, 2011 10:16 To: Timo; pygtk@daa.com.au Subject: RE: [pygtk] gio.Mount.get_default_location() That's really weird. I've reinstalled python-gobject and gir1.2-glib-2.0 but the problem persists and it also happens on my other pc. I also created a new user account locally because maybe it was some weird entry in my .bashrc or something but that didn't help either. There's also another weird issue. When I do from gi.reposityory import Gtk (and other modules too) I get this exception: http://paste.ubuntu.com/615673/ Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Timo [timomli...@gmail.com] Sent: Wednesday, June 01, 2011 09:13 To: pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() On 31-05-11 20:38, Leon Bogaert wrote: Hi Avi, Good guess :) I'm running Ubuntu 11.04 Weird, I'm running 11.04 as well, and I have no problems. No idea why it won't work for you though. Cheers, Timo leon@polly:~$ dpkg -l | grep gir | grep glib ii gir1.2-glib-2.0 0.10.7-0ubuntu1 Introspection data for GLib, GObject, Gio and GModule leon@polly:~$ ls -al /usr/lib/girepository-1.0/Gio-2.0.typelib -rw-r--r-- 1 root root 241632 2011-04-05 12:36 /usr/lib/girepository-1.0/Gio-2.0.typelib I've also tried running Gio.MountMountFlags.NONE on my other machine (also 11.04): same error. I've also got a Fedora 15 box and there it works! The package of gobject-introspection there is 0.10.8-1 Regards, Leon From: Avi Levy [avi...@gmail.com] Sent: Tuesday, May 31, 2011 19:26 To: Leon Bogaert Cc: John Stowers; pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() I can verify that John's instructions work on my system: Gio.MountMountFlags.NONE enum G_MOUNT_MOUNT_NONE of type GMountMountFlags It looks like you are running Linux, if possible what distro? For instance, I am running Ubuntu and the package containing gir bindings for gio is called gir1.0-glib-2.0 (0.9.3-0) the relevant file containing gio bindings is: /usr/lib/girepository-1.0/Gio-2.0.typelib It sounds like you may have an out-of-date typelib or something? ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
I already tried that: In [3]: Gio.MountMountFlags.NONE --- AttributeErrorTraceback (most recent call last) /home/leon/ipython console in module() AttributeError: type object 'MountMountFlags' has no attribute 'NONE' Here's the dir of Gio.MountMountFlags: http://pastebin.com/B3An5qAW I'm wondering why I don't have that attribute. Regards, Leon From: John Stowers [john.stowers.li...@gmail.com] Sent: Tuesday, May 31, 2011 03:25 To: Leon Bogaert Cc: Johannes Sasongko; pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() On Mon, 2011-05-30 at 22:37 +, Leon Bogaert wrote: Thanks for the help. I think I fail to understand. Well experiment, try all the options... Gio.MountMountFlags.NONE -- works hint: dir(Gio.MountMountFlags) ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
Hi Avi, Good guess :) I'm running Ubuntu 11.04 leon@polly:~$ dpkg -l | grep gir | grep glib ii gir1.2-glib-2.0 0.10.7-0ubuntu1 Introspection data for GLib, GObject, Gio and GModule leon@polly:~$ ls -al /usr/lib/girepository-1.0/Gio-2.0.typelib -rw-r--r-- 1 root root 241632 2011-04-05 12:36 /usr/lib/girepository-1.0/Gio-2.0.typelib I've also tried running Gio.MountMountFlags.NONE on my other machine (also 11.04): same error. I've also got a Fedora 15 box and there it works! The package of gobject-introspection there is 0.10.8-1 Regards, Leon From: Avi Levy [avi...@gmail.com] Sent: Tuesday, May 31, 2011 19:26 To: Leon Bogaert Cc: John Stowers; pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() I can verify that John's instructions work on my system: Gio.MountMountFlags.NONE enum G_MOUNT_MOUNT_NONE of type GMountMountFlags It looks like you are running Linux, if possible what distro? For instance, I am running Ubuntu and the package containing gir bindings for gio is called gir1.0-glib-2.0 (0.9.3-0) the relevant file containing gio bindings is: /usr/lib/girepository-1.0/Gio-2.0.typelib It sounds like you may have an out-of-date typelib or something? ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
Thanks for the help. I think I fail to understand. I was under the impression I could do something like Gio.MountMountFlags.MOUNT_MOUNT_NONE (or something). But that doesn't work. This does: In [32]: Gio.MountMountFlags(0) Out[32]: enum G_MOUNT_MOUNT_NONE of type GMountMountFlags But that doesn't see logical to me. Using something as Gio.MountMountFlags.MOUNT_MOUNT_NONE makes it easy to spot what's going on there but just passing a 0 as argument doesn't make things clearer. Is using Gio.MountMountFlags(0) the way to go? Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Johannes Sasongko [sason...@gmail.com] Sent: Monday, May 30, 2011 11:36 To: pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() Do you perhaps also know where I can get those mounting flags? I've looked at Gio.MountMountFlags but they don't contain anything. This is probably a gtk-doc bug -- there are two instances of a name=GMountMountFlags in the page. Search for enum GMountMountFlags and you'll find the right one. Which, amusingly enough, is just typedef enum { G_MOUNT_MOUNT_NONE = 0 } GMountMountFlags; -- Johannes ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
I'm migrating my gio code from the static binding to gi. But I have a problem with a callback. For example: def callback(): pass location = Gio.file_new_for_uri('ssh://kees@concepts') mo = Gtk.MountOperation() location.mount_enclosing_volume(mo, callbackz) When you run that I get: Traceback (most recent call last): File test_gi.py, line 82, in module location.mount_enclosing_volume(mo, 'callbackz') File /usr/lib/python2.7/dist-packages/gi/types.py, line 44, in function return info.invoke(*args) TypeError: Error invoking Gio.mount_enclosing_volume: Unexpected value for argument 'callback' The docs say I also can provide 'None' (http://developer.gnome.org/pygobject/stable/class-giofile.html#method-giofile--mount-enclosing-volume) but that gives the same error. Is this something not yet implemented or am I doing something wrong? Regards, Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
Sorry, the type is not in the actual code. So even without the type the error persists :) Even if I replace the callback by 'None' the error occurs. Regards, Leon From: Avi Levy [avi...@gmail.com] Sent: Sunday, May 29, 2011 20:03 To: Leon Bogaert Cc: pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() In the code you typed, there is a typo right? You pass callbackz to mount_enclosing_volume but you defined only the function callback Does the issue persist after fixing this? On Sun, May 29, 2011 at 10:43 AM, Leon Bogaert l...@tim-online.nlmailto:l...@tim-online.nl wrote: I'm migrating my gio code from the static binding to gi. But I have a problem with a callback. For example: def callback(): pass location = Gio.file_new_for_uri('ssh://kees@concepts') mo = Gtk.MountOperation() location.mount_enclosing_volume(mo, callbackz) When you run that I get: Traceback (most recent call last): File test_gi.py, line 82, in module location.mount_enclosing_volume(mo, 'callbackz') File /usr/lib/python2.7/dist-packages/gi/types.py, line 44, in function return info.invoke(*args) TypeError: Error invoking Gio.mount_enclosing_volume: Unexpected value for argument 'callback' The docs say I also can provide 'None' (http://developer.gnome.org/pygobject/stable/class-giofile.html#method-giofile--mount-enclosing-volume) but that gives the same error. Is this something not yet implemented or am I doing something wrong? Regards, Leon ___ pygtk mailing list pygtk@daa.com.aumailto:pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
Could somebody try this code on their machine? http://pastebin.com/Q3UqQrND From: Leon Bogaert Sent: Sunday, May 29, 2011 20:14 To: Avi Levy Cc: pygtk@daa.com.au Subject: RE: [pygtk] gio.Mount.get_default_location() Sorry, the type is not in the actual code. So even without the type the error persists :) Even if I replace the callback by 'None' the error occurs. Regards, Leon From: Avi Levy [avi...@gmail.com] Sent: Sunday, May 29, 2011 20:03 To: Leon Bogaert Cc: pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() In the code you typed, there is a typo right? You pass callbackz to mount_enclosing_volume but you defined only the function callback Does the issue persist after fixing this? On Sun, May 29, 2011 at 10:43 AM, Leon Bogaert l...@tim-online.nlmailto:l...@tim-online.nl wrote: I'm migrating my gio code from the static binding to gi. But I have a problem with a callback. For example: def callback(): pass location = Gio.file_new_for_uri('ssh://kees@concepts') mo = Gtk.MountOperation() location.mount_enclosing_volume(mo, callbackz) When you run that I get: Traceback (most recent call last): File test_gi.py, line 82, in module location.mount_enclosing_volume(mo, 'callbackz') File /usr/lib/python2.7/dist-packages/gi/types.py, line 44, in function return info.invoke(*args) TypeError: Error invoking Gio.mount_enclosing_volume: Unexpected value for argument 'callback' The docs say I also can provide 'None' (http://developer.gnome.org/pygobject/stable/class-giofile.html#method-giofile--mount-enclosing-volume) but that gives the same error. Is this something not yet implemented or am I doing something wrong? Regards, Leon ___ pygtk mailing list pygtk@daa.com.aumailto:pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
Thank you very much! Worked like a charm! Do you perhaps also know where I can get those mounting flags? I've looked at Gio.MountMountFlags but they don't contain anything. Leon From: John Stowers [john.stowers.li...@gmail.com] Sent: Monday, May 30, 2011 00:28 To: Leon Bogaert Cc: pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() On Sun, 2011-05-29 at 20:49 +, Leon Bogaert wrote: Could somebody try this code on their machine? http://pastebin.com/Q3UqQrND You are reading the wrong docs. The pygobject docs which bind gio are for pre gobject-introspection times. For gobject-introspection you must refer to the C docs (and unfortunately guess how they map to python). Yes I know this sucks. The following works http://developer.gnome.org/gio/stable/GFile.html#g-file-mount-enclosing-volume location.mount_enclosing_volume(0, mo, None, callbackz, None) John ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
Does anyone know how to get the default location of a gio mount? Or maybe knows a place where I could better ask? Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Leon Bogaert [l...@tim-online.nl] Sent: Wednesday, April 20, 2011 01:11 To: pygtk@daa.com.au Subject: [pygtk] gio.Mount.get_default_location() Hi all, I'm trying to put something together with python and gio. I'm trying to get the default location for a mount (home directory for example). The c api has a g_mount_get_default_location() function: http://developer.gnome.org/gio/2.26/GMount.html#g-mount-get-default-location But the python api doesn't (it's not in the docs): http://developer.gnome.org/pygobject/stable/class-giomount.html Anyone know why this method isn't added? Should I file a bug report about this? And where? And is there a another way to get the default location? Thanks in advance! Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gio.Mount.get_default_location()
Hi Pietro, Thank you! Worked like a charm. Never new of gi. Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Pietro Battiston [m...@pietrobattiston.it] Sent: Friday, May 27, 2011 16:36 To: pygtk@daa.com.au Subject: Re: [pygtk] gio.Mount.get_default_location() Il giorno ven, 27/05/2011 alle 11.10 +, Leon Bogaert ha scritto: Does anyone know how to get the default location of a gio mount? Or maybe knows a place where I could better ask? Well, if you can affort to migrate to gi... from gi.repository import Gio print Gio.Mount.get_default_location bye Pietro Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Leon Bogaert [l...@tim-online.nl] Sent: Wednesday, April 20, 2011 01:11 To: pygtk@daa.com.au Subject: [pygtk] gio.Mount.get_default_location() Hi all, I'm trying to put something together with python and gio. I'm trying to get the default location for a mount (home directory for example). The c api has a g_mount_get_default_location() function: http://developer.gnome.org/gio/2.26/GMount.html#g-mount-get-default-location But the python api doesn't (it's not in the docs): http://developer.gnome.org/pygobject/stable/class-giomount.html Anyone know why this method isn't added? Should I file a bug report about this? And where? And is there a another way to get the default location? Thanks in advance! Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] gio.Mount.get_default_location()
Hi all, I'm trying to put something together with python and gio. I'm trying to get the default location for a mount (home directory for example). The c api has a g_mount_get_default_location() function: http://developer.gnome.org/gio/2.26/GMount.html#g-mount-get-default-location But the python api doesn't (it's not in the docs): http://developer.gnome.org/pygobject/stable/class-giomount.html Anyone know why this method isn't added? Should I file a bug report about this? And where? And is there a another way to get the default location? Thanks in advance! Leon 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://faq.pygtk.org/
Re: [pygtk] Python wrapper for gnomeprint
Hi all, I'm creating a comboboxentry with an entrycompletion. But the popup of the comboboxentry itself (when you push the arrow on the right) is different from the autocompletion popup. ComboBoxEntry: http://imgur.com/PMzablZFMPX Autocompletion: http://imgur.com/PMzabZFMPXl With GtkComboBox::appears-as-list I can make them both look the same. BUT, the autocompletion width is only the width of the entry and not the complete width of the ComboBoxEntry widget. Is there a way I can change the popup width? Thanks in advance! Regards, Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Python wrapper for gnomeprint
I believe the package is: python-gnomeprint Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Vince [vef1...@gmail.com] Sent: Sunday, December 12, 2010 02:16 To: pygtk@daa.com.au Subject: [pygtk] Python wrapper for gnomeprint I am using UBUNTU 10.10 . To use Xword ( D/L from synaptic package manager), to print a thinks.com crossword puzzle, I get the error message Print libraries not installed. Please install python wrapper for gnomeprint How can I do that ? Is there a command line I can use in TERMINAL? I have tried to install many files referring to Python wrapper , using Synaptic but so far none work Note that previous versions of UBUNTU, using XWORD worked just by installing and running itl Any help in this matter is greatly appreciated ! ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Problem with gtk.TextView in Windows, but not in Linux
Linux and windows use different types of line breaks. Linux uses \n and Windows \r\n (And mac \r I believe). So I think you should add an extra \r when your program is run on Windows and the user hits enter. I don't know why Textview doesn't do that itself. I'm a pygtk beginner myself... Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of James Simmons [nices...@gmail.com] Sent: Friday, December 10, 2010 01:39 To: PyGTK Mailing List Subject: [pygtk] Problem with gtk.TextView in Windows, but not in Linux I have written a simple program for proofing and correcting OCR'd text that I'm going to include in a book I'm writing about making e-books. The program has a left pane and a right pane. The left pane is a gtk.TextView and the right pane is a gtk.Image. The idea is that the left pane shows the OCR'd text created from the image in the right pane. You use the text view to make corrections to the text and save them. You can see the code here: http://git.sugarlabs.org/e-book-making-scripts/mainline/blobs/master/proofer.py This program works flawlessly in Linux, but not in Windows. In Windows everything works *except* when you hit the Enter key in the TextView. It does not insert a new line. What's odd is that if you look at a file edited with the program in Windows in Linux then you DO see the inserted lines, so they are going into the text buffer but the TextView does not show them. Every other key works just fine in Windows. It's just the Enter key that's messed up. I'm using the very latest Python plus the very latest PyGTK, Cairo, PyGObject, and GTK+ bundle. If anyone has ideas on how to work around this I'd sure like to hear them. For myself I can use the program under Linux, but I want my readers to be able to use it under Windows and the Mac as well. James Simmons ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] gtk table with border
Hi all, I've created a window with some widgets in it. They're layed out with a gtkTable. I would like to have a border around the top row of that table. What are my options.I've read that a border isn't part of the default table. But what _can_ I do to draw a border? Or even better, would it be possible to draw an image over that area? A transparent one. And, something different, what would be the best way to animate the colon when the timer is running? I thought about emitting a signal every x time from my timer object. When the signal is received: replace the colon with a space. Would this be a good idea? :) Thanks again! Regards, Leon attachment: Screenshot-9.png___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] self from gtk.builder
Thanks. I'll use that aproach. I saw a lot of self.wTree's so I'll stick with that naming convention. Regards, Leon From: Pietro Battiston [...@pietrobattiston.it] Sent: Monday, December 06, 2010 09:31 To: Leon Bogaert Cc: marco.giu...@gmail.com; pygtk@daa.com.au Subject: Re: [pygtk] self from gtk.builder Il giorno lun, 06/12/2010 alle 00.28 +, Leon Bogaert ha scritto: Thanks Marco, Messing with __getattr__... I think I'm going to let that pass. It feels kinda messy. I'm just begining with gtk and I've been browsing through other people's code but I find it difficult to organize my gtk code. Anyway, the main message is: if you must use a widget created through a glade file, you can live without subclassing it. For the ordinary operations, you can just do class ActionsMenu(object): def __init__(self, widget): self.widget = widget and then access the widget argument when you need it; if instead you have to override some method, you can do class ActionsMenu(object): def __init__(self, widget): self.widget = widget self.widget.do_size_request = my_newly_written_size_request My personal (and not particularly authoritative) impression is that while in the traditional pygtk approach you (grossly speaking) create a subclass for each important widget in your app, when you use glade/gtk.Builder you just create subclasses for conceptually important objects, which may then be related to (and have as members) 0, 1, or many widgets each. And that this is, in the end, the traditional way to organize Python code. Pietro ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] gtk.Entry fontsize
I've been trying to edit a gtk.Enyry's fontsize by doing something like this: gtkEntry.modify_font(pango.FontDescription('courier Medium 32')) But the fontsize (and family) of the gtk entry doesn't change. This works: gtk.rc_parse_string( style entryTime_style { font_name=Sans Serif 24 } class GtkEntry style entryTime_style ); But I would rather copy the pango context and just change the fontsize. But I can't get that working. Does anyone has a working example? Also, is it possible to change the (inner) background of an entry to transparent? I'm trying to create a window like the Timer in the attachment. Regards, Leon attachment: Untitled Page.jpg___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] gtk.Entry fontsize
Hi Max, You example worked like a charm! But i think I'm trying to set the fontsize before it is displayed. And I can't get that working. This doesn't work: def on_entryTime_show(self, event): self.entry_time.set_text('Enter new font size here') font_description = pango.FontDescription('Lucida Sans %s' % 24) self.entry_time.modify_font(font_description) But this does: def on_entryTime_button_press_event(self, widget, event): self.entry_time.modify_font(font_description) font_description = pango.FontDescription('Lucida Sans %s' % 24) self.entry_time.set_text('ZzZzZz...') How can I adjust the size when the widget is shown? Adjusting it right after gtk.builder doesn't work also. Regards, Leon From: Max Usachev [maxusac...@gmail.com] Sent: Monday, December 06, 2010 10:48 To: Leon Bogaert Subject: Re: [pygtk] gtk.Entry fontsize Hi, Leon Bogaert This example works for me: import gtk import pango def change_font_size_cb(widget, entry): print 'changing font' try: font_description = pango.FontDescription('Lucida Sans %s' % int(entry.get_text())) entry.modify_font(font_description) except: print 'Wrong fontsize value' window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.resize(200, 80) window.set_title('Entry font size example') window.connect('destroy', gtk.main_quit) entry = gtk.Entry() entry.set_text('Enter new font size here') button = gtk.Button('Change size') button.connect('clicked', change_font_size_cb, entry) vbox = gtk.VBox() vbox.pack_start(entry, expand=True, fill=True) vbox.pack_start(button, expand=False, fill=True) window.add(vbox) window.show_all() gtk.main() You can find more info about pango at: http://www.pygtk.org/docs/pygtk/class-pangofontdescription.html Br, Max. 2010/12/6 Leon Bogaert l...@tim-online.nlmailto:l...@tim-online.nl I've been trying to edit a gtk.Enyry's fontsize by doing something like this: gtkEntry.modify_font(pango.FontDescription('courier Medium 32')) But the fontsize (and family) of the gtk entry doesn't change. This works: gtk.rc_parse_string( style entryTime_style { font_name=Sans Serif 24 } class GtkEntry style entryTime_style ); But I would rather copy the pango context and just change the fontsize. But I can't get that working. Does anyone has a working example? Also, is it possible to change the (inner) background of an entry to transparent? I'm trying to create a window like the Timer in the attachment. Regards, Leon ___ pygtk mailing list pygtk@daa.com.aumailto:pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] self from gtk.builder
Thanks Marco, Messing with __getattr__... I think I'm going to let that pass. It feels kinda messy. I'm just begining with gtk and I've been browsing through other people's code but I find it difficult to organize my gtk code. Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Marco Giusti [marco.giu...@gmail.com] Sent: Sunday, December 05, 2010 22:40 To: pygtk@daa.com.au Subject: Re: [pygtk] self from gtk.builder On Sun, Dec 05, 2010 at 08:54:28PM +, Leon Bogaert wrote: Hi all, Is it possible to do something like this? class ActionsMenu(gtk.Menu): def __init__(self): builder = gtk.Builder() builder.add_from_file(bctimer.xml) self = builder.get_object(menuActions) yes but it doesn't do what you think: it rebinds the name `self` to the builder object but the other references point to the `ActionsMenu`. what you can do is something like the following: class BaseWindow(object): def __init__(self, builder, auto_connect=True): self.__builder = builder if auto_connect: builder.connect_signals(self) def __getattr__(self, n): w = self.__builder.get_object(n) if w is not None: return w raise AttributeError, n or even, but not tested: ... def __getattr__(self, n): w = self.__builder.get_object(n) if w is not None: setattr(self, n, w) # here the point return w raise AttributeError, n m. -- Excellentium virorum est improborum negligere contumeliam, a quibus etiam laudari turpe. -- Plutarco ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] which widget
Hi Robert, Thanks! It's difficult to decise how the user should be alerted of the fact the input isn't valid. I was looking for an app that does rouglly the same. But I only found one and that implementation doesn't really work well :) A colleague of mine does some interface designing occasionally. I think I'll ask him tomorrow how he thinks about that. Regards, Leon From: ad...@exolucere.ca [ad...@exolucere.ca] on behalf of Robert Park [rbp...@exolucere.ca] Sent: Thursday, December 02, 2010 19:03 To: Leon Bogaert Cc: pygtk@daa.com.au Subject: Re: [pygtk] which widget On Thu, Dec 2, 2010 at 12:16 AM, Leon Bogaert l...@tim-online.nl wrote: Yeah, but how should I for it to always be on the entries in the ListStore? Because now one can type anything in the combobxEntry. A user could type something, ignore the suggestions and move the focus to another widget. How should I deal with this situations? For example, an on_update handler which checks if the entry in the comboBoxEntry exists in the liststore. If it doesn't exist: remove the entry. But that doesn't seem really user friendly. Well, your signal handler will know what value the user has typed. Simply check if that value exists in your liststore, and if it doesn't, there's any number of things you could do. You could: refocus the combobox when the user tries to focus away from it, discard any invalid entry the user has typed, display an error dialog instructing the user to type something else instead. You just have to be careful to balance your need to have the input validated with the users need to not be overly hassled with cumbersome restrictions on their interaction with the program. -- http://exolucere.ca ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] which widget
Hi Steve, thanks for the links. They both look promising! From: Stephen George [steve_...@optusnet.com.au] Sent: Thursday, December 02, 2010 22:21 To: Leon Bogaert Cc: pygtk@daa.com.au Subject: Re: [pygtk] which widget On 2/12/2010 6:16 PM, Leon Bogaert wrote: Yeah, but how should I for it to always be on the entries in the ListStore? Because now one can type anything in the combobxEntry. A user could type something, ignore the suggestions and move the focus to another widget. How should I deal with this situations? For example, an on_update handler which checks if the entry in the comboBoxEntry exists in the liststore. If it doesn't exist: remove the entry. But that doesn't seem really user friendly. Have a look at http://www.astro.umass.edu/~dpopowich/python/ for the thing called ValidatedEntry. While it is not a solution to your problem, it does have hooks in place to prevent the user from leaving the entry until the data entered is valid, .. I believe it's this functionality that you are looking for your combo box, to stop the user leaving the combo box till they have selected a valid entry from your liststore. There is a demo inside the download, but usage of the demo is not so intuitive, you need to do through the code to understand what your are meant to do. It might give you enough ideas to cobble up something useful. Also I notice this http://www.gtkforums.com/about4619.html which may be more applicable to what your asking. Steve ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] which widget
Hi all, I'm new to gtk and I don't really know what widget to use for this case; I have a long list of projects. At first it thought about using a combobox but I would really like the user to type the project he/she wants. And it should be fuzzy. So it doesn't only match the first part of the string but ideally searches through some properties on an object. It should work a bit like the suggestions from Google. I've also read up on the comboboxentry but I don't really know how I can make it so only values from the list are allowed. Anyone know what would be the easiest way to do this? Regards, Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] which widget
Nevermind, I found this thread: http://stackoverflow.com/questions/2250477/entry-with-suggestions So my questions now becomes: how can I (combobox)entry with suggestions and force it to be one of the entries in the ListStore? Thanks! Regards, Leon From: pygtk-boun...@daa.com.au [pygtk-boun...@daa.com.au] on behalf of Leon Bogaert [l...@tim-online.nl] Sent: Wednesday, December 01, 2010 23:37 To: pygtk@daa.com.au Subject: [pygtk] which widget Hi all, I'm new to gtk and I don't really know what widget to use for this case; I have a long list of projects. At first it thought about using a combobox but I would really like the user to type the project he/she wants. And it should be fuzzy. So it doesn't only match the first part of the string but ideally searches through some properties on an object. It should work a bit like the suggestions from Google. I've also read up on the comboboxentry but I don't really know how I can make it so only values from the list are allowed. Anyone know what would be the easiest way to do this? Regards, Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] which widget
Yeah, but how should I for it to always be on the entries in the ListStore? Because now one can type anything in the combobxEntry. A user could type something, ignore the suggestions and move the focus to another widget. How should I deal with this situations? For example, an on_update handler which checks if the entry in the comboBoxEntry exists in the liststore. If it doesn't exist: remove the entry. But that doesn't seem really user friendly. From: ad...@exolucere.ca [ad...@exolucere.ca] on behalf of Robert Park [rbp...@exolucere.ca] Sent: Thursday, December 02, 2010 07:22 To: Leon Bogaert Cc: pygtk@daa.com.au Subject: Re: [pygtk] which widget On Wed, Dec 1, 2010 at 3:59 PM, Leon Bogaert l...@tim-online.nl wrote: So my questions now becomes: how can I (combobox)entry with suggestions and force it to be one of the entries in the ListStore? Well, you'd have to attach a signal handler to your comboboxentry, and in the handler you'd define all your fuzzy matching logic. -- http://exolucere.ca ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Gnome panel applet troubles
OK, I found it: I had to use this fix: applet.set_background_widget(applet) and my applet extended the gnomeapplet.Applet class. After removing that it worked! Regards, Leon From: Leon Bogaert Sent: Saturday, November 27, 2010 19:51 To: pygtk@daa.com.au Subject: Gnome panel applet troubles Hi all, I'm having some troubles with how my gnome panel looks. I've attached some screenshots so you can see what I mean. The left applet is the hamster applet for time tracking. The applet on the right is my applet. As you can see in the first screenshot (Screenshot-3.png) the background of my applet is weird. The lower half is another color than the top part. If I hover over my applet (Screenshot-5.png) the background turns bright. The hamster applet doesn't have that. And it's even weirder when I put a label in it. Then the color of the font in the label is very dark so it's almost unreadable. What could I be doing wrong? I don't get it. My Applet init method: def __init__(self, applet, iid): logging.debug('__init__') # save the applet object self.applet = applet # determine the size to draw the icon size = self.applet.get_size() - 2 #Get theme, find SVG icon and put it in a pixbuf theme = gtk.icon_theme_get_default() pixbuf = theme.load_icon(self.icon_name, size, gtk.ICON_LOOKUP_FORCE_SVG) #Load image image = gtk.image_new_from_pixbuf(pixbuf) # set up the applet tooltip self.applet.set_tooltip_text(self.title) self.button = gtk.Button() self.button.set_relief(gtk.RELIEF_NONE) self.button.set_image(image) self.button.connect('button-press-event', self.button_press) self.applet.add(self.button) self.applet.show_all() Thanks in advance! Regards, Leon ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Gnome panel applet troubles
Hi all, I'm having some troubles with how my gnome panel looks. I've attached some screenshots so you can see what I mean. The left applet is the hamster applet for time tracking. The applet on the right is my applet. As you can see in the first screenshot (Screenshot-3.png) the background of my applet is weird. The lower half is another color than the top part. If I hover over my applet (Screenshot-5.png) the background turns bright. The hamster applet doesn't have that. And it's even weirder when I put a label in it. Then the color of the font in the label is very dark so it's almost unreadable. What could I be doing wrong? I don't get it. My Applet init method: def __init__(self, applet, iid): logging.debug('__init__') # save the applet object self.applet = applet # determine the size to draw the icon size = self.applet.get_size() - 2 #Get theme, find SVG icon and put it in a pixbuf theme = gtk.icon_theme_get_default() pixbuf = theme.load_icon(self.icon_name, size, gtk.ICON_LOOKUP_FORCE_SVG) #Load image image = gtk.image_new_from_pixbuf(pixbuf) # set up the applet tooltip self.applet.set_tooltip_text(self.title) self.button = gtk.Button() self.button.set_relief(gtk.RELIEF_NONE) self.button.set_image(image) self.button.connect('button-press-event', self.button_press) self.applet.add(self.button) self.applet.show_all() Thanks in advance! Regards, Leonattachment: Screenshot-3.pngattachment: Screenshot-4.pngattachment: Screenshot-5.png___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/