Re: [pygtk] [GTK3] get background color
On 08/01/2013 02:00 AM, Osmo Salomaa wrote: Here is a very simple scrpit that shows the problem. For me it prints: Gdk.Color(red=0.00, green=0.00, blue=0.00, alpha=0.00) For editable text fields, you're probably looking for the *base* color. style.lookup_color(theme_base_color) For Adwaita, you can find the available color names in gtk-main.css [1], but I really don't know if they work across different themes. [1] https://git.gnome.org/browse/gnome-themes-standard/tree/themes/Adwaita/gtk-3.0/gtk-main.css I am under XFCE / GTK2 theme, so there is no such file in my theme. My gtkrc file has a base[NORMAL] = #ff line, but I don't know how to get that with gtk3. It should be possible as it's correctly rendered. style.lookup_color(theme_base_color) returns a 0, 0, 0, 0 color here. -- Yann ___ 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] [GTK3] get background color
On 07/31/2013 07:33 PM, Timo wrote: Op 31-07-13 13:48, Yann Leboulanger schreef: On 01/29/2013 02:18 PM, Yann Leboulanger wrote: Hi, I'm trying to get the default / current background color of a textview. The code I do it: context = tv.get_style_context() color = context.get_background_color(Gtk.StateFlags.NORMAL) But that returns a fully transparent color (0,0,0,0) If I first set a custom color with tv.override_background_color(), then get_background_color() correctly works and returns the color I set. So how can I get the current default color? I still can't get it working with GTK-3.8.2 and python3-gi 3.8.3 Any idea? Did you wait untill the treeview is realized? treeview.connect('realize', get_bg_color) def get_bg_color(widget): style = widget.get_style_context() bgcolor = style.get_background_color(Gtk.StateType.NORMAL) print(bgcolor) Yes treeview is realized for sure, this code happens in a callback when I press a key. -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] [GTK3] get background color
Hi, I'm trying to get the default / current background color of a textview. The code I do it: context = tv.get_style_context() color = context.get_background_color(Gtk.StateFlags.NORMAL) But that returns a fully transparent color (0,0,0,0) If I first set a custom color with tv.override_background_color(), then get_background_color() correctly works and returns the color I set. So how can I get the current default color? Thanks in advanced -- Yann ___ 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] [GTK3] get background color
On 01/29/2013 02:35 PM, Niklas Koep wrote: Sounds like you're trying to retrieve the default colors before the widget has been realized. Consider this (mind you this uses pygtk): No, this is done AFTER the widget is realized. It's done in a textbiffer 'changed' callback, a long time (several seconds) after widget is shown. Your code is what I used in pygtk, but I'm not able to find a working equivalent in pygobject. -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] PyGobject set pixbuf value to None
Hi, I am trying to port my application to Gobject introspection, and I am facing a problem. I have a TreeModel that contains a GdkPixbuf.Pixbuf in one of its columns. When I try to do: model[iter][PIXBUF_COL] = None I get a Traceback saying: TypeError: Argument 3 does not allow None as a value So I wonder how can I do to not show a pixbuf for this iter. I found this thread suggesting that it's a bug in GObject, but is that true? http://comments.gmane.org/gmane.comp.genealogy.gramps.devel/23022 Thanks in advance for your help, -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] segfault
Hi, We are experiencing a strange bug in our application, which result sometimes in a segfault, and sometimes in a freeze of the application. it's related to accel groups. In our application (quite big, and I haven't tried to make a small test case, but if someone is interested I can point to the code in our application), we open a window, and in the constructor, we create an accel group and attach it to the window ([0]). One of the handled keys in Escape, and we close the window when we press Esc ([1]). If I play to open the window, press Esc, open the window, press Esc, etc... At some point the application will segfault or freeze. We gathered the output of gdb and strace (strange thing about futex??), attached to this mail, but we don't know how to go further in the debugging. Any idea about that? Thanks in advanced. [0] http://hg.gajim.org/gajim/file/93f6e8ddbc2a/src/message_window.py#l103 [1] http://hg.gajim.org/gajim/file/93f6e8ddbc2a/src/message_window.py#l423 -- Yann (gdb) bt #0 0x74628ba5 in gtk_accel_groups_activate () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #1 0x7481e8ec in gtk_window_activate_key () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #2 0x7481e959 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #3 0x746ee538 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #4 0x76020804 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #5 0x760325bf in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #6 0x7603bbe3 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #7 0x7603bfb2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #8 0x74807451 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #9 0x746ec797 in gtk_propagate_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #10 0x746eca23 in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #11 0x743581ec in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 #12 0x759530cf in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #13 0x759538c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #14 0x75953e02 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #15 0x746eba77 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #16 0x74da2f14 in ?? () from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so #17 0x004c62a2 in PyEval_EvalFrameEx () #18 0x004ccee6 in PyEval_EvalCodeEx () #19 0x00577901 in PyRun_FileExFlags () #20 0x00577b37 in PyRun_SimpleFileExFlags () #21 0x00550497 in Py_Main () #22 0x769a1ead in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6 #23 0x0041dea1 in _start () recvfrom(4, 0x29ea2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}]) writev(4, [{\22\0\7\0009\10\300\2[\1\0\0\6\0\0\0 \4\5\0\1\0\0\0\w\231(\24\0\6\0..., 52}, {NULL, 0}, {, 0}], 3) = 52 poll([{fd=4, events=POLLIN}], 1, -1)= 1 ([{fd=4, revents=POLLIN}]) recvfrom(4, \1 LV\4\0\0\0\6\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..., 4096, 0, NULL, NULL) = 48 recvfrom(4, 0x29ea2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}]) writev(4, [{\16\0\2\0008\10\300\2, 8}, {NULL, 0}, {, 0}], 3) = 8 poll([{fd=4, events=POLLIN}], 1, -1)= 1 ([{fd=4, revents=POLLIN}]) recvfrom(4, \1\30MV\0\0\0\0\255\0\0\0\n\0%\0\364\1\220\1\0\0\0\0\0\0\0\0\0\0\0\0, 4096, 0, NULL, NULL) = 32 recvfrom(4, 0x29ea2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) recvfrom(4, 0x29ea2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=4, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=4, revents=POLLOUT}]) writev(4, [{(\0\4\0008\10\300\2\255\0\0\0\0\0\0\0, 16}, {NULL, 0}, {, 0}], 3) = 16 poll([{fd=4, events=POLLIN}], 1, -1)= 1 ([{fd=4, revents=POLLIN}]) recvfrom(4, \1\1NV\0\0\0\0\345\275\333\0a\3n\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0, 4096, 0, NULL, NULL) = 32 recvfrom(4, 0x29ea2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) recvfrom(4, 0x29ea2c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) open(/home/zimio/.config/gajim/.config.test, O_WRONLY|O_CREAT|O_TRUNC, 0666) = 18 fstat(18, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 fstat(18, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcfe5d3f000 write(18, last_sounds_dir = \nnotif_signout..., 4096) = 4096 write(18, multiple_tabs =
Re: [pygtk] How to clear/delete all values from the gtk.Liststore
Le 13/12/2011 16:14, Arun p das a écrit : I am new to pygtk. currently i am doing one application using pygtk and glade. my Question is How to clear/delete all values from the gtk.Liststore. I am using the liststore as model for combobox. http://pygtk.org/docs/pygtk/class-gtkliststore.html will help you. liststore.clear() is the function you're looking for. -- Yann ___ 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 options
On 04/22/2011 12:03 AM, Robert Schroll wrote: On 04/21/2011 04:37 PM, Yann Leboulanger wrote: But it seems I have to use GOptionContext, but that doesn't seem to exist in PyGTK. OptionContext is in gobject, at least for me (2.21.1). Can't help you with the rest, I'm afraid. Thanks, I didn't find it because it's not in documentation on pygtk website. Now it seems that to get the list of options supported by gtk, there is a function: gtk_get_option_group () ([1]) but once again I don't find it in python bindings. I looked for gtk.get_option_group(), glib.get_option_group(), gobject.get_option_group(). is there a reason it's not available? Or am I blind? [1]: http://developer.gnome.org/gtk/stable/gtk-General.html#gtk-get-option-group ___ 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 options
On 04/05/2011 11:59 AM, Yann Le Boulanger wrote: Hi, In my PyGTK grogram, I try to use gnome session. I'm able to make gnome start my program on startup, but it launches it with some command line optins like --sm-config-prefix, --sm-client-id, ... The problem is that my application doesn't accept unknown command line options. So I'm searching a solution to tell gnome to parse them, and give me only the remaining option. Is it the correct way to do that? But it seems I have to use GOptionContext, but that doesn't seem to exist in PyGTK. Any idea how I can separate gnome session options from others? And maybe how I can save my program preferences in gnome session and get them when my program is restarted? Nobody uses gnome session with pygtk? How do you handle that? Thanks in advance for any help -- Yann ___ 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] Testing PyGTK installer for Mac OS X
Le 15/03/2011 09:00, Anders F Björklund a écrit : I don't have a MAC, but one of my friend tested it, and it works, he was able to run Gajim on it with your package. The only thing he has to do was to install the hicolor icon theme. (some folder + one index.theme in /usr/share/icons/hicolor/ I think it should be installed by your package. Hmm, isn't this package part of freedesktop rather than gtk+ ? And amazingly, this 1 file and empty dirs is GPL... So it can't be included in a LGPL (+compatible) package ? Maybe yes. I wonder how many GTK programs depends on it though. At least mine does, and I don't know how to not depend on it. We have to depend on a gtk theme, and I thought there was at least one in gtk, and I thought it was hicolor hicolor-icon-theme is the default icon theme that all icon themes automatically inherit from. I have no idea how mac packages work, but is there a dependancy thing? Could your package depend on a hicolor-icon-theme package? -- Yann Leboulanger ___ 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] Testing PyGTK installer for Mac OS X
Le 15/03/2011 10:38, Anders F Björklund a écrit : hicolor-icon-theme is the default icon theme that all icon themes automatically inherit from. In practice, all it does is avoid that warning. Since it doesn't include any icons, it would still show the missing image (the doc with red x). So it's kinda useless ? And when looking at tango-icon-theme, it doesn't seem to reference it anyway. The problem is that my program complete the hicolor them to add some icons, so I created the hicolor folders structure, then added some icons in it, and in my code I call gtk_icon_theme = gtk.icon_theme_get_default() gtk_icon_theme.append_search_path(ICONS_DIR) But my icons are not used if hicolor theme doesn't exists. I always thought that using gtk icon theme was a nicer idea than loading images. It handles size automatically. -- Yann ___ 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] Testing PyGTK installer for Mac OS X
On 03/11/2011 12:45 PM, Anders F Björklund wrote: Hi, we needed a simpler way to install PyGTK on Mac OS X, besides using macports/fink or jhbuild to compile it... So we are testing an all-in-one (= both gtk+ and pygtk) Universal installer for Mac OS X 10.5 Leopard and later: http://afb.users.sourceforge.net/zero-install/PyGTK.pkg It's for both python versions (python2.5 and python2.6) and built for all three architectures: ppc, i386, x86_64. It's modeled after the existing gtk+ bundle for Windows, but rebuilt (as .tgz) from scratch using custom scripts: http://afb.users.sourceforge.net/zero-install/buildscripts/ Feedback appreciated. Wow! Awsome! First, thanks for this package. I don't have a MAC, but one of my friend thested it, and it works, he was able to run Gajim on it with your package. The only thing he has to do was to install the hicolor icon theme. (some folder + one index.theme in /usr/share/icons/hicolor/ I think it should be installed by your package. Except, once again a great thanks! -- Yann Leboulanger ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 11/02/2010 10:53 AM, John Stowers wrote: On Thu, 2010-10-28 at 11:52 +1300, John Stowers wrote: On Sat, 2010-10-16 at 20:00 +1300, John Stowers wrote: PyGObject 2.26 (for glib-2.26.0) http://www.johnstowers.co.nz/files/win32/pygobject-2.26.0.win32-py2.6.exe http://www.johnstowers.co.nz/files/win32/pygobject-2.26.0.win32-py2.7.exe Pycairo 1.8.10 http://www.johnstowers.co.nz/files/win32/pycairo-1.8.10.win32-py2.6.exe http://www.johnstowers.co.nz/files/win32/pycairo-1.8.10.win32-py2.7.exe PyGTK 2.22 (for gtk+-2.22.0) http://www.johnstowers.co.nz/files/win32/pygtk-2.22.0.win32-py2.6.exe http://www.johnstowers.co.nz/files/win32/pygtk-2.22.0.win32-py2.7.exe Final attempt. The only change is that these were built with --user-access-control=auto Can those that saw errors during install on vista/7 please test. Once someone confirms they work I'll put them on GNOME FTP Cheers, John pycairo - no error pygobject - no error pygtk - no error Perfect! Thanks!! Now I have to see with GTK why tree.rc_get_style().bg[gtk.STATE_ACTIVE].to_string() returns #. -- Yann ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 10/28/2010 12:52 AM, John Stowers wrote: On Sat, 2010-10-16 at 20:00 +1300, John Stowers wrote: Hi All, I spent some time updating the windows installers for PyGObject, PyGTK and Pycairo. Hi All, Thanks for your feedback and testing. I updated the installers again to hopefully correct the bug some were seeing on install. I also generated installers for Python2.7. Can those who got an error on install please test these to ensure that this is no longer present. I still have the same error when installing pygobject and pygtk: close failed in file object destructor: Error in sys.excepthook: Original exception was: And I still have the problem with styles, but that's probably not due to windows installers. Thanks for your work -- Yann ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 10/28/2010 11:12 AM, Dieter Verfaillie wrote: Hi, Quoting John Stowers john.stowers.li...@gmail.com: Yeah, styles is something different. Can you please run the installer from the console and see if it prints anything else of interest please? What is your target system, etc? Does anyone else have any ideas on this? This might be caused by leftover files from a previous installation. At least, the error stopped for me once I manually cleaned my pyg* environment last year. Uninstall pygtk, pygobject, pycairo (and other pyg* bindings if you have them) and manually delete the following (if those files/dirs are still there...): pythonroot\include\pycairo pythonroot\include\pygtk-2.0 pythonroot\Lib\pkgconfig pythonroot\Lib\site-packages\cairo pythonroot\Lib\site-packages\gtk-2.0 pythonroot\Lib\site-packages\pygtk* pythonroot\share\gtk-doc pythonroot\share\pygobject pythonroot\share\pygtk Then reinstall pycairo, pygobject and pygtk. If you still get the error after that, I'd like to know about it. That would mean something goes wrong when the pkgconfig file gets fixed during the installation process (in postinstall). I did all that, reinstalled everything, and I still get error on pygobject and pygtk. Funny thing is that if I run the .exe from command line, I don't get error, but a success message and the end of the installer. I'm installing on a win7, python 2.6.4 -- Yann ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 10/28/2010 02:04 PM, Dieter Verfaillie wrote: Hi, Quoting Yann Leboulanger aste...@lagaule.org: I did all that, reinstalled everything, and I still get error on pygobject and pygtk. Funny thing is that if I run the .exe from command line, I don't get error, but a success message and the end of the installer. I'm installing on a win7, python 2.6.4 I added some logging to the postinstall script and made a new pygobject snapshot, available from [1]. Could you give it a try and post the log from the last page of the installer? Thanks, Dieter [1] http://www.optionexplicit.be/projects/gnome-windows/20101028/pygobject-2.26.0.win32-py2.6.exe I uninstalled everything, removed previously listed folder, installed this pygobject, and still the same error at the end, without any debugging thing. I only see: close failed in file object destructor: Error in sys.excepthook: Original exception was: And still no error when run from command line -- Yann ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 10/28/2010 02:49 PM, Dieter Verfaillie wrote: Quoting Yann Leboulanger aste...@lagaule.org: On 10/28/2010 02:04 PM, Dieter Verfaillie wrote: I uninstalled everything, removed previously listed folder, installed this pygobject, and still the same error at the end, without any debugging thing. I only see: For the pygobject installation? That's really strange... There's only one test I can think of we can still try: uninstall again, remove everything as described before but also delete: pythonroot\Scripts\pygobject* pythonroot\Scripts\pygtk* pythonroot\Scripts\pygtk* pythonroot\pygobject-wininst.log pythonroot\pygtk-wininst.log Then install pycairo, then the pygobject version I sent you and look again at the contents of the last page of the pygobject installer. What's the output? Nothing more, still the same thing. Oh, there's a second thing we can check. - Did you install Python for all users or just for me in windows 7? For all users - If installed for all users, do you run pygobject-2.26.0.win32-py2.6.exe as admin? Yes, I install it as admin (right click - run as admin). But anyway there is only one account that have admin rights. - Does windows 7 ask for permission to run the .exe as admin? Yes -- Yann ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 10/28/2010 03:52 PM, Dieter Verfaillie wrote: Quoting Yann Leboulanger aste...@lagaule.org: Nothing more, still the same thing. Ok, I'm quite sure this is not an issue with the postinstall script itself. I've made 3 new build to make sure. All 3 have their pygobject_postinstall.py replaced with simply: = import sys if len(sys.argv) == 2: if sys.argv[1] == '-install': print ('Great, you\'ve reached the postinstall script') = This means if you see Great, you've reached the postinstall script on the last page, the installer worked. The first [1] one is compiled as usual and will most certainly produce the error message. The second [2] and third [3] have been compiled with the bdist_wininst uac option set to various values. Could you try them out? I'll bet the first doesn't work, but hope 2 and 3 do... I confirm: first one raises the same error and second and third one works: I see Great, you've reached the postinstall script -- Yann ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 10/16/2010 09:00 AM, John Stowers wrote: Hi All, I spent some time updating the windows installers for PyGObject, PyGTK and Pycairo. I would appreciate it if those interested tested these installers before they go on the official GNOME servers. The installers are * PyGObject 2.26 (for glib-2.26.0) http://www.johnstowers.co.nz/files/win32/pygobject-2.26.0.win32-py2.6.exe * Pycairo 1.8.10 http://www.johnstowers.co.nz/files/win32/pycairo-1.8.10.win32-py2.6.exe * PyGTK 2.22 (for gtk+-2.22.0) http://www.johnstowers.co.nz/files/win32/pygtk-2.22.0.win32-py2.6.exe These require the installation of the appropriate dependencies. However, to make this step easier, and until Tor updates the gtk+ bundle, Armin Burgmeier provided me with an interim gtk+ bundle [1]. This can be downloaded from the following address, http://www.johnstowers.co.nz/files/win32/gtk +-bundle-win32-devel-2.22.zip Once extracted to C:\GTK (for example), you will need to add C:\GTK\bin to your path. The installers and dependencies will be removed from my site and moved to the GNOME servers once verified that they work. Some technical details about the installers * Built against Python 2.6.6 * Source code comes from the 'windows' branch of each project (on git.gnome.org) * They were built using wine-1.2+MinGW on Ubuntu 10.04 as my laptop with a windows install is on loan. This means they have not been tested on a real windows install yet... * Yes, this actually works. * The script to generate the installers lives at http://gist.github.com/629505 * MinGW with GCC-4.5.0 was used for the compilation. * gtk+-2.22 sees the return of the windows theme! Please test this by setting adding the following line to C:\GTK\etc\gtk-2.0\gtkrc (for example) gtk-theme-name = MS-Windows Happy testing and good luck, John [1] Extracted from the well polished gtkmm windows installer http://live.gnome.org/gtkmm/MSWindows ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ things seems to work quite nicely! Great ! Some comments though: When installing pygobject and pygtk, at the end of the installer in the textview there is an error message: close failed in file object destructor: Error in sys.excepthook: Original exception was: But that doesn't prevent things to work. Second point : there seems to be a problem with styles: tree.rc_get_style().bg[gtk.STATE_ACTIVE].to_string() return #, then I do renderer.set_property('cell-background', col2) and background is black, of course, but bg[gtk.STATE_ACTIVE] should not return Black, I don't use a black theme. Thanks for this installers!! -- Yann ___ 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] Call For Testing: Updated PyGObject, Pycairo and PyGTK for Windows
On 10/16/2010 03:01 PM, steve_...@optusnet.com.au wrote: * gtk+-2.22 sees the return of the windows theme! Please test this by setting adding the following line to C:\GTK\etc\gtk-2.0\gtkrc (for example) gtk-theme-name = MS-Windows Tried this, .. it seems to work. things seems to work quite nicely! Great ! Some comments though: When installing pygobject and pygtk, at the end of the installer in the textview there is an error message: close failed in file object destructor: Error in sys.excepthook: Original exception was: But that doesn't prevent things to work. You mean in the textview of the installer (lastpage?), I didn't see any such error message. I am testing on XP with python 2.6.5. Yes exactly. I tested on win7. -- Asterix ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] cell_renderers order
Hi all, Once you added several renderers into a column, is there a way to get the order of the renderers? I'd like to get renderers with column.get_cell_renderers() then add a renderer in the middle of the list, and re-add them to the column. But to re-add them in the same order as it was before, I need to know the previous order ... Thanks for your help -- Yann ___ 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] Py2exe + gtk.IconTheme
On 07/28/2010 10:52 AM, Yann Leboulanger wrote: Hi, Do some people here uses Py2exe to package a pygtk application that uses gtk.IconTheme? Recently I switch to gtk.IconTheme in my application, and since this moment, py2exe doesn't work anymore. I did a very very short test application that shows the problem (attached files) If some of you have ideas on how to fix that, that would be nice! I forgot to mention that the error message I get is : AttributeError: 'gtk.IconTheme' object has no attribute 'append_search_path' Any idea where could be the problem? -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Py2exe + gtk.IconTheme
Hi, Do some people here uses Py2exe to package a pygtk application that uses gtk.IconTheme? Recently I switch to gtk.IconTheme in my application, and since this moment, py2exe doesn't work anymore. I did a very very short test application that shows the problem (attached files) If some of you have ideas on how to fix that, that would be nice! -- Yann from distutils.core import setup import py2exe import glob py26MSdll = glob.glob(rPy26MSDlls\*.*) python26_files = [(Microsoft.VC90.CRT, py26MSdll), (lib\Microsoft.VC90.CRT, py26MSdll), ] opts = { 'py2exe': { # ConfigParser,UserString,roman are needed for docutils 'includes': ('pango,atk,gobject,cairo,pangocairo,gtk.keysyms,' 'encodings,encodings.*,ConfigParser,UserString'), 'dll_excludes': [ 'iconv.dll', 'intl.dll', 'libatk-1.0-0.dll', 'libgdk_pixbuf-2.0-0.dll', 'libgdk-win32-2.0-0.dll', 'libglib-2.0-0.dll', 'libgmodule-2.0-0.dll', 'libgobject-2.0-0.dll', 'libgthread-2.0-0.dll', 'libgtk-win32-2.0-0.dll', 'libpango-1.0-0.dll', 'libpangowin32-1.0-0.dll', 'libcairo-2.dll', 'libpangocairo-1.0-0.dll', 'libpangoft2-1.0-0.dll', ], 'excludes': [ 'docutils' ], 'optimize': 1, } } setup( name='Test', version='0.1', description='Test program', author='THE Team', url='URL', download_url='URL2', license='GPL', windows=[{'script': 'test_icontheme.py', 'icon_resources': [(1, 'test.ico')]}], options=opts, data_files=python26_files, )import gtk gtk_icon_theme = gtk.icon_theme_get_default() gtk_icon_theme.append_search_path('.') print 'ok'___ 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 InfoBar documentation?
On 06/29/2010 08:59 AM, catalinf...@gmail.com wrote: Example is wrong . See error : Traceback (most recent call last): File infobar.py, line 46, inmodule InfoBar() File infobar.py, line 13, in __init__ self.infobar = gtk.InfoBar() AttributeError: 'module' object has no attribute 'InfoBar' You need a GTK / PyGTK version 2.18 -- Yann Leboulanger ___ 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] pygtk.glade import problem
On 04/30/2010 04:28 PM, Krisztian Buza wrote: Dear Colleagues, I am new with Python. I have installed Python (version 2.6), PyGTK and Glade (http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/) under Windows. The import pygtk command works nice (i.e. without error message), but import pygtk.glade does not seem to work: I get this error message: No module named glade. I tried to add the glade-directories to the path: C:\Program Files\Glade\lib\glade3\modules;C:\Program Files\Glade\bin; May be, I did not add the right glade directories? Could anyone help me? Thank you very much in advance, Maybe you forgot to install python-glade2? -- Yann ___ 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] to make a window with tabs in GLADE
varnikat t a écrit : I want to make a window with tabs (not menubar menuitems) like how 'about me' window opens in ubuntu with tabs at top like Contact , Address, Help On clicking on each shows something in the frame below them How to make a window that way in GLADE? Waiting eagerly Regards Varnika Tewari Using gtk.Notebook widget. -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] strange behaviour with py2exe
Hi all, My application uses those lines: gtk_icon_theme = gtk.icon_theme_get_default() gtk_icon_theme.append_search_path(DIR) It works well when I run it from command line. Now if I run py2exe on my app, when I run it I have this error: Traceback (most recent call last): File gajim.py, line 157, in module AttributeError: 'gtk.IconTheme' object has no attribute 'append_search_path I use gtk 2.16.5, pygtk 2.16.0, python2.6 Any idea why this error arrives, but only once py2exe'ed? -- Yann ___ 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] Statusicon under Windows 7
John Stowers wrote: On Tue, 2010-02-09 at 19:38 +0100, Yann Leboulanger wrote: Yann Leboulanger wrote: Hi all, Under windows seven (and probably windows server) gtk.statusicon disappear from systray. Even if we ask Windows to keep it in systay, it stays until we restart the program. Is there something I did badly? I attach a small testcase. Nobody uses gtk.Statusicon under windows7? I guess not on this list. Can you please file a bug at bugzilla.gnome.org John ok, here it is: https://bugzilla.gnome.org/show_bug.cgi?id=609622 -- Yann ___ 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] Statusicon under Windows 7
Yann Leboulanger wrote: Hi all, Under windows seven (and probably windows server) gtk.statusicon disappear from systray. Even if we ask Windows to keep it in systay, it stays until we restart the program. Is there something I did badly? I attach a small testcase. Nobody uses gtk.Statusicon under windows7? -- Yann ___ 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.Window focus problem
Mallikarjun(ಮಲ್ಲಿಕಾರ್ಜುನ್) wrote: Dear friends, I have written a small application, which is a very tiny and exits by pressing escape. But I am not able to bring the window on to front on launch. print self.window.is_focus()-- Output is False print self.window.is_active()-- Output is False Ofcourse I wrote it on pygtk :) Can someone help me. http://pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--present should help you -- Yann ___ 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.Window focus problem
Mallikarjun(ಮಲ್ಲಿಕಾರ್ಜುನ್) wrote: On Sun, Feb 7, 2010 at 3:54 PM, Yann Leboulanger aste...@lagaule.org mailto:aste...@lagaule.org wrote: Mallikarjun(ಮಲ್ಲಿಕಾರ್ಜುನ್) wrote: Dear friends, I have written a small application, which is a very tiny and exits by pressing escape. But I am not able to bring the window on to front on launch. print self.window.is_focus()-- Output is False print self.window.is_active()-- Output is False Ofcourse I wrote it on pygtk :) Can someone help me. http://pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--present should help you Thanks for the help, this is not doing the trick or I am not able to make it work Can you provide some example? call it in a iddle add, so that it's called after window is realized -- Yann ___ 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] can't import gtk
Mathew Yeates wrote: here's a snippet. import gtk Thats it! I immediately get the error. So your pygtk installation is not complete most probably. ry re-installing it and its dependances -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Statusicon under Windows 7
Hi all, Under windows seven (and probably windows server) gtk.statusicon disappear from systray. Even if we ask Windows to keep it in systay, it stays until we restart the program. Is there something I did badly? I attach a small testcase. -- Yann Leboulanger #!/usr/bin/env python import gtk import pygtk def quit_cb(widget, data = None): if data: data.set_visible(False) gtk.main_quit() def popup_menu_cb(widget, button, time, data = None): if button == 3: if data: data.show_all() data.popup(None, None, None, 3, time) statusIcon = gtk.StatusIcon() menu = gtk.Menu() menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT) menuItem.connect('activate', quit_cb, statusIcon) menu.append(menuItem) statusIcon.set_from_stock(gtk.STOCK_HOME) statusIcon.set_tooltip(StatusIcon test) statusIcon.connect('popup-menu', popup_menu_cb, menu) statusIcon.set_visible(True) gtk.main() ___ 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] ANN: PyGUI 2.1.1
John Finlay a écrit : I'm disappointed that I appear to be the only one on this list that finds these announcements objectionable. And contrary to speculation I find them all objectionable (yes that means yours as well Roberto). So far it's been lucky that not all of the hundreds of projects based on pygtk have felt it necessary to send announcements to the list and I thank them for their restraint. I would suggest that an announcement only maillist be setup for those who wish to send and receive these announcements but I fear that many would continue to spam this list anyway. John I agree with you, I'm not subscribed to this ML to hear about PyGUI or any other projects. PyGUI and all other projects should setup their own ML and do their ad themself. Just my point of view. -- Yann ___ 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] announcement policy
Alessandro Dentella wrote: On Thu, Nov 19, 2009 at 06:19:31PM +0100, Yann Leboulanger wrote: John Finlay a écrit : I'm disappointed that I appear to be the only one on this list that finds these announcements objectionable. And contrary to speculation I I don't find announcement on PyGTK addons objectionable and surely not just becouse I'm amoung those who send these announcement every now and then, but becouse I like to be informed on what's moving aroung the pygtk world and I happened to use software that was advertized on this list. The subject ANN makes it so easy to skip if you are not interested... And we are talking about 3% of the traffic, including announcement of PyGTK/Pygobject that are not questionable and make 1/4 of the announcements. To be even more clear, I would rather prefer if announcement stayed in this same list. PyGUI on the other hand is not an addon to pygtk. It's 3% of the traffic because none of the project developpers announce their projets here. If all projets announce their release here, it will be 97% of the traffic ___ 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_IS_WIDGET on subclass of a widget fails
Jeffrey Finkelstein a écrit : Kelvin Ho wrote: Have a look at this: http://fuhm.net/super-harmful/ ;) Interesting...so what can _I_ do then? This seems like a problem above me... call HBox.__init__(self), as it was suggested, it will work. ___ 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] [ANNOUNCE] PyGTK 2.15.0 - unstable
Gian Mario Tagliaretti wrote: A new unstable development release of the Python bindings for GTK+ has been released. The new release is available from ftp.gnome.org and its mirrors as soon as its synced correctly: http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.15/ Would it be possible to have windows releases at the same time of sources? 2.14 is still not available for windows. Thanks for this new release! -- Yann ___ 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.label + wrapping
Gian Mario Tagliaretti wrote: On Fri, Jan 30, 2009 at 7:33 PM, Yann Leboulanger aste...@lagaule.org wrote: Hi Yann, I have a gtk.Label, filled with a long text. I enabled wrap on this label, so that text is splitted into several lines. The problem is that when I increase window width, the wrapping is not re-computed. I had the same problem some time ago, I've stolen some code from libview and make it pure python, look at the WrapLabel class. http://www.gnome.org/~gianmt/busybox.py cheers Thanks for the link, I was also given this one: https://fedorahosted.org/python-slip/browser/slip/gtk/__init__.py It's quite the same thing. It work nicely, except if label has xalign to 0.5. -- Yann ___ 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.label + wrapping
Hi guys, I have a gtk.Label, filled with a long text. I enabled wrap on this label, so that text is splitted into several lines. The problem is that when I increase window width, the wrapping is not re-computed. I tried to set_line_wrap() to False then True every 2 seconds, but still it's not re-computed. I tried to re-set text every 2 seconds, but still it's not re-computed. I tried to set_max_width_chars(-1) every 2 seconds, but still it's not re-computed. I tried to set_property('width-chars', -1) every 2 seconds, but still it's not re-computed. I have no more ideas. Is it doable without using a textview (which don't look the same way at all)? -- Yann ___ 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_accel_groups_activate ()
Gian Mario Tagliaretti wrote: On Wed, Dec 31, 2008 at 9:55 AM, Yann Le Boulanger aste...@lagaule.org wrote: Any idea why this function is not implemented in pygtk? It's in the ignore list in gtk.override, I don't know why though. If you want to remove it from ignore, recompile pygtk and test it, if it works we could fix it later, I suspect there is a reason why someone put it in the ignore section. I'm not very faniliar with python bindings, so I won't be able to debug anything :/ please open a bug report. Done: http://bugzilla.gnome.org/show_bug.cgi?id=566493 -- Yann ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] popup menu in gtk.statusicon under windows
I attached a script that create a gtk.statusicon, and create a menu that is shown when I right click. In this menu, there is a submenu, which contain a second menuitem. The callback of this second menuitem is not called under windows, but it is under linux. Is it a bug in windows ? GTK 2.12.9 PyGTK 2.12.1 -- Yann #!/usr/bin/env python import gtk import pygtk def quit_cb(widget, data = None): if data: data.set_visible(False) gtk.main_quit() def cb(widget, data=None): print 'cb' def popup_menu_cb(widget, button, time, data = None): if button == 3: if data: data.show_all() data.popup(None, None, None, 3, time) statusIcon = gtk.StatusIcon() menu = gtk.Menu() menuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT) menuItem.connect('activate', quit_cb, statusIcon) menu.append(menuItem) sm = gtk.Menu() menuItem = gtk.MenuItem('asd') menuItem.set_submenu(sm) menuItem2 = gtk.MenuItem('asdf') menuItem2.connect('activate', cb) sm.append(menuItem2) menu.append(menuItem) statusIcon.set_from_stock(gtk.STOCK_HOME) statusIcon.set_tooltip(StatusIcon test) statusIcon.connect('popup-menu', popup_menu_cb, menu) statusIcon.set_visible(True) gtk.main() ___ 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] spam?
Am I the only one to be spammed by quoll.daa.com.au with mails from pygtk ML from 2007 ? -- Yann ___ 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 version of gtk / pygtk used
awalter1 a écrit : Hi, I'm working with Linux RedHat EL4. a version of gtk+ was installed with the release RedHat : rpm -qa returns this version. Others more recente versions of gtk+ have been installed from sources : not recognize from rpm. Same things for pygtk. My application is written in python. How to know which versions of gtk+/pygtk is used by my application ? import gtk gtk.gtk_version (2, 10, 11) gtk.pygtk_version (2, 10, 4) -- Yann ___ 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] [Fwd: PyGTK in Vista?]
Rafael Villar Burke a écrit : Sujet: PyGTK in Vista? Expéditeur: Nicklas Larsson [EMAIL PROTECTED] Date: Sat, 1 Dec 2007 07:44:48 +0100 Destinataire: [EMAIL PROTECTED] Destinataire: [EMAIL PROTECTED] Hi, I have tried to install PyGTK in Microsoft Windows Vista but failed. I have installed GTK+ runtime, and that wen well, but I got dialogs during installation of PyCairo, PyGObject, and PyGTK telling me that some things could not be created. At the end however, they tell me that it is installed. From python, I get DLL load failed when I do import gtk. I am in no way a Windows Vista expert, I just thought it would be nice to be able to also run my graphical python applications both on Linux and on Windows. The package of PyGTK I found was from November 2006. I found no information on your site about Microsoft Windows Vista. Regards, Nicklas Larsson you installed pycairo, pygobject and pygtk from there? http://pygtk.org/downloads.html pygtk version there is from 30 August 2007 -- Yann ___ 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] utf8 validating string
John Ehresman wrote: Yann Leboulanger wrote: I'd like not to have it. But I getthis string by gpg-decodding a message send by Miranda IM. I think it's a bug in their GnuPG implementation, but anyway I'd like my client to detect those bad string and a) print message correctly if I can or b) don't traceback and print a warning message. But for that I need a function that tells me that g_utf8_validate will fail ... You probably should explicitly decide how to handle \0. If it's always at the end, it's probably just a simple bug and can be chopped off but it may be something more if valid text follows the \0. But in general, I think this'll work: def valid_glib_utf8(s): try: unicode(s, 'utf-8') except Exception: return False else: return '\x0' not in s In case you need it s.replace('\x0', '') will remove the \0's. Cheers, John That doesn't work: import gtk tv = gtk.TextView() b = tv.get_buffer() t = test\x00 u = unicode(t, 'utf-8') b.set_text(t) __main__:1: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed it's the same if I try with the unicode: import gtk tv = gtk.TextView() b = tv.get_buffer() t = test\x00 u = unicode(t, 'utf-8') b.set_text(u) __main__:1: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed -- Yann ___ 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] utf8 validating string
John Ehresman wrote: I'm confused here; I think your last example passes '\x0' to a gtk function which does not work. Either remove the '\x0' or do something else with \x0 here. Or am I missing something? removeing the \x0 isn't a problem, a replce can do that, but is it the only char that will cause this problem? -- Yann ___ 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] utf8 validating string
Hi, I have a string that a textview can't display. It contains invalid chars: t = Let's check this out.\x00 import gtk tv = gtk.TextView() b = tv.get_buffer() b.set_text(t) __main__:1: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed but when I di that I have no problem: t.decode('utf-8') uLet's check this out.\x00 so what could I do to validate the string before sending it to GTK? ___ 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] utf8 validating string
John Ehresman wrote: Yann Leboulanger wrote: Hi, I have a string that a textview can't display. It contains invalid chars: t = Let's check this out.\x00 import gtk tv = gtk.TextView() b = tv.get_buffer() b.set_text(t) __main__:1: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed but when I di that I have no problem: t.decode('utf-8') uLet's check this out.\x00 try: u = unicode(t, 'utf-8') except Exception: print 'not utf8' else: b.set_text(t) John import gtk tv = gtk.TextView() b = tv.get_buffer() t = Let's check this out.\x00 u = unicode(t, 'utf-8') b.set_text(t) __main__:1: GtkWarning: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed but b.set_text(u) works ... is it the way to go? ___ 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] Flashing widget background
Peter Brooks wrote: Hi all, I'm looking to getting widgets in my program to flash, such as ardour does for it's record button. Currently my thinking is to create a new thread to keep changing the background colour. However I'm trying to find out if there's already implementations of this out there. I've looked at ardour's but I am finding tracing how they do it taking quite a bit of time given their project maturity. Wouldn't a gobject.timeout_add() be enough? That call a function every X ms, in which you can change the color of your widget. -- Yann ___ 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] Trouble with TreeViews
Caleb Marcus a écrit : I've read those, but I can't quite understand how to get it to work. I've attached a glade XML file and a Python file that I'm using to test the ability to manipulate TreeViews in Python. I'm just trying to get Column1text into the first column, and the number 2 into the second column, but it's not working... could anyone help me get this figured out? If you're running it, you'll need python-glade, and both files will need to be in the same directory. On Sun, 2007-11-11 at 19:21 +0100, Gian Mario Tagliaretti wrote: 2007/11/11, Caleb Marcus [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: I'm pretty new to Python, and days-new to GTK, and the TreeView widget is confusing the hell out of me... is there a good guide to using it? the pygtk tutorial has got a section dedicated to the treeview widget: http://www.pygtk.org/pygtk2tutorial/ch-TreeViewWidget.html also check the pygtk FAQ: http://faq.pygtk.org/index.py?req=index cheers ___ 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/ replace text=1 and text=2 by text=0 and text=1 -- Yann ___ 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] modelfilter + expand attribute
Hi all, I have a treeview with rows and sub-rows. This treeview gets his data in a treemodelFilter. Now I collapse rows in thee treeivew, then, I run modelfilter.refilter() Problem appears: rows that I collapsed are now expanded. Is it a bug in GTK or normal behavior? Is there a way to change that, or to workaround it? -- Yann ___ 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] treeview w/ markup
John Hunter wrote: I have a simple treeview and list store, and want to make certain cell/row combinations red ___ 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/ use the column.set_cell_data_func() then in the callback you can set background color of the cell as you wish according to the row -- Yann ___ 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] Signal order
Hi, Here is the senario. I have a treeview and a entry. I write some text in the entry. Then I click on the treeview to change the row. The problem I have is that the cursor_changed signal of the treeview is emited BEFORE the focus_out_event signal of the entry. I don't really understand this order as it sounds to me that to change the cursor, the treeviews must have focus, so the focus_out_event signal should be emited first. In case it's not a bug but a wanted behaviour, I'd like to find a signal on the entry that is emited before the cursor_changed, is it possible ? -- Yann ___ 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/