[pygtk] Re: New pygtk and gnome-python releases
tor 2002-01-31 klockan 12.41 skrev Chris Chabot: When trying to compile this brand sparkling new gnome-python release, i run into the following error: /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/python2.2 -I/usr/include/pygtk-2.0 -I/usr/include/gconf/2 -I/usr/include/bonobo-activation-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/linc-1.0 -I/usr/include/libxml2 -O2 -march=i686 -mcpu=i686 -Wall -std=c9x -c -o gconfmodule_la-gconf.lo `test -f gconf.c || echo './'`gconf.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/python2.2 -I/usr/include/pygtk-2.0 -I/usr/include/gconf/2 -I/usr/include/bonobo-activation-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/linc-1.0 -I/usr/include/libxml2 -O2 -march=i686 -mcpu=i686 -Wall -std=c9x -c gconf.c -MT gconfmodule_la-gconf.lo -MD -MP -MF .deps/gconfmodule_la-gconf.TPlo -fPIC -DPIC -o gconfmodule_la-gconf.o gconf.override:10:36: gconf/gconf-enum-types.h: No such file or directory make[2]: *** [gconfmodule_la-gconf.lo] Error 1 make[2]: Leaving directory `/usr/src/redhat/BUILD/gnome-python-1.99.7/gconf' make[1]: *** [all-recursive] Error 1 When removing this include, it fails miserably on all kinds of missing defines... which seem to be defined in gconf.defs? Any simple way to 'fix' this? Update gconf. -- Chris James Henstridge wrote: New pygtk and gnome-python releases are available, which should work with the recent gtk+ 1.3.13 release and gnome 2.0 desktop alpha. This release of gnome-python depends on orbit-python (without it, only the canvas module will be built). The packages are available at: ftp://ftp.gtk.org/pub/gtk/python/v1.3/pygtk-1.99.7.tar.gz ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/gnome-python/gnome-python-1.99.7.tar.gz ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/orbit-python/orbit-python-1.99.0.tar.gz The pygtk release contains many bug fixes, almost working threading support (based on Sopwith's original patch), new examples for pygtk-demo, and half working support for automatically generating signal and property docs for the online help (doesn't quite work because of a python bug). There is also a few improvements I added to the code generator, which allowed the bonobo bindings to integrate better with the orbit bindings. The gnome-python release contains many new features (it is more than 50k larger than the last release). These include bindings for libbonobo, libbonoboui, libgnomeui, GConf, nautilus views and panel applets. The majority of this work was done by Johan Dahlin. The orbit-python package is a port of the stable orbit-python to ORBit2. This porting work was also done by Johan Dahlin. As always, report bugs at http://bugzilla.gnome.org/ James. ___ desktop-devel-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/desktop-devel-list ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] GCC with -ansi option
Hi, I'm having some trouble compiling PyGTK from CVS. I get errors like these: /gnome/head/INSTALL/include/glib-2.0/glib/gmessages.h:108: warning: invalid character in macro parameter name The remedy seems to be removing the '-ansi' flag from the CFLAGS attribute. AKAIK the '...' in macro definitions is a GCC specific feature, therefore setting '-ansi' will error on those statements. Note that I did not configure GLib with the --enable-ansi option. I noticed this flag is explicitly set in configure.in (line 129). It should not be set if GLib is not compiled with ansi-compliance. Regards, Arjan ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] Freeing GObjects in Python
Hi, I'm using PyGTK (2.0) to do the graphical representation in a UML modeling tool (http://gaphor.sourceforge.net). I have created a small demo setup in a test program like this: + Model node + Package + Actor (data element) + UseCase (data element) + Diagram The diagram holds a DiaCanvas canvas inside, with two canvas items: one referencing the actor and one to the use case. Here comes my problem: If I remove all references to the data structure, no objects seem to be freed (at least the objects in the canvas are not freed). is it possible to wrap the canvas is such a way that it can be freed using the garbage collector? I noticed that the PyGObject has the HAVE_GC flag set. As it is now, the canvas object will only free itself if an explicit del diagram.canvas is done. It looks like the wrapper will not free the object, even if it holds only one reference... What can I do about this? Regards, Arjan ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Re: New pygtk and gnome-python releases
On 31 Jan 2002, Johan Dahlin wrote: tor 2002-01-31 klockan 12.41 skrev Chris Chabot: [... removed removed removed ...] When removing this include, it fails miserably on all kinds of missing defines... which seem to be defined in gconf.defs? Any simple way to 'fix' this? Update gconf. One has to praise Johan's succintness :-) Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] no comments, so faq updated.
Well, not updated, really: I added no new entries, but updated in the fact that it is recategorized and ready to be worked upon again. Will add some qa this evening. Thanks. http://www.async.com.br/faq/pygtk/ Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] Patch: GtkTreeModel and refenecing objects
Hi, I've created a patch that adds a 'leak_references' property to the GenericTreeModel. Turning this feature off (default is on, the old behaviour) will always decrement the refcount on PyObjects. This will prevent memory/refcnt leaks from happening. The Model should ensure that objects which are user as iterator are not destroyed before the iterator is destroyed. This sounds a bit silly, but there are no other way, unless we get to know when a iterator is being removed... Regards, Arjan ? x Index: ChangeLog === RCS file: /cvs/gnome/gnome-python/pygtk/ChangeLog,v retrieving revision 1.347 diff -u -r1.347 ChangeLog --- ChangeLog 2002/01/31 08:32:24 1.347 +++ ChangeLog 2002/01/31 15:20:04 @@ -1,3 +1,14 @@ +2002-01-31 Arjan Molenaar [EMAIL PROTECTED] + + * gtk/pygtktreemodel.h: Added attribute leak_references to + PyGtkGenericTreeModel. + * gtk/pygtktreemodel.c: Added property `leak_references'. This will + toggle the leak_references attribute (default TRUE: old behaviour) + Implemented `leak_references': a Python object will always be + deferenced if it is set on an iterator. This will prevent memory/refcnt + leaks, but the model should always be sure there is a refenence to the + iterator object. + 2002-01-31 James Henstridge [EMAIL PROTECTED] * configure.in: increment version number of package and Index: gtk/pygtktreemodel.c === RCS file: /cvs/gnome/gnome-python/pygtk/gtk/pygtktreemodel.c,v retrieving revision 1.6 diff -u -r1.6 pygtktreemodel.c --- gtk/pygtktreemodel.c2001/10/09 04:05:33 1.6 +++ gtk/pygtktreemodel.c2002/01/31 15:20:07 @@ -11,10 +11,27 @@ /* define this to print out debug messages */ #undef DEBUG_TREE_MODEL +#ifndef _ +# define _(s) (s) +#endif + +enum { +PROP_LEAK_REFERENCES = 1 +}; + static void pygtk_generic_tree_model_class_init(PyGtkGenericTreeModelClass *klass); static void pygtk_generic_tree_model_init(PyGtkGenericTreeModel *self); static void pygtk_generic_tree_model_iface_init(GtkTreeModelIface *iface); +static void pygtk_generic_tree_model_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void pygtk_generic_tree_model_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); + GType pygtk_generic_tree_model_get_type(void) { @@ -51,6 +68,22 @@ static void pygtk_generic_tree_model_class_init(PyGtkGenericTreeModelClass *klass) { +GObjectClass *object_class = (GObjectClass*) klass; + +object_class-get_property = pygtk_generic_tree_model_get_property; +object_class-set_property = pygtk_generic_tree_model_set_property; + +g_object_class_install_property (object_class, +PROP_LEAK_REFERENCES, +g_param_spec_boolean (leak_references, + _(Leak references), + _(Enable referencing iterator + objects (this will cause a memory leak or at least a reference + counting leak). You might need it though, if you return newly + created objects.), + TRUE, + G_PARAM_READWRITE)); + } static guint pygtk_generic_tree_model_get_flags(GtkTreeModel *tree_model); @@ -102,8 +135,38 @@ static void pygtk_generic_tree_model_init(PyGtkGenericTreeModel *self) { +self-leak_references = TRUE; +} + +static void +pygtk_generic_tree_model_set_property (GObject *object, guint property_id, + const GValue *value, GParamSpec *pspec) +{ +switch (property_id) { +case PROP_LEAK_REFERENCES: + PYGTK_GENERIC_TREE_MODEL (object)-leak_references = g_value_get_boolean +(value); + break; +default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; +} } +static void +pygtk_generic_tree_model_get_property (GObject *object, guint property_id, + GValue *value, GParamSpec *pspec) +{ +switch (property_id) { +case PROP_LEAK_REFERENCES: + g_value_set_boolean (value, + PYGTK_GENERIC_TREE_MODEL (object)-leak_references); + break; +default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; +} +} + PyGtkGenericTreeModel * pygtk_generic_tree_model_new(void) { @@ -224,6 +287,9 @@ if (py_ret) { if (py_ret !=
[pygtk] threading issue...
Short Question: is there any way for the current thread to know that it doesn't have to call gtk.threads_enter() Long Question: I've got a function that can be called either by the thread responsible for gtk.mainloop() (call it the 'original' thread) or an 'outsider' thread that was spun off. The function makes a call that eventually gets down to some gtk stuff, so... therein lies the dilemma. My understanding is that the 'outsider' thread needs to call gtk.threads_enter() to ensure no collisions. The 'original' thread, however will cause a deadlock if it calls gtk.threads_enter(). I want them to both use the same function: def EventSelectedPlayer(self): self.debug( event: selected player id: + \ str(self.selectedPlayer.GetID()) ) #gtk.threads_enter() self.gameView.EventSelectedPlayer( self.selectedPlayer ) #gtk.threads_leave() So: has anyone done anything like this before? What is the strategy? Do I only call gtk.threads_enter() conditionally on whether the thread already owns the lock? If so, how do I find out Thanks for any help, sjbrown signature.asc Description: This is a digitally signed message part
[pygtk] Tutorials
I remember people posting tutorial URLs to this list, but I can't seem to find them to add them to the FAQ. Can people please send them in again? And other documentation attempts? Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] Re: Disabling Tearoff Menus
On Sat, 5 Jan 2002, W. Borgert wrote: you asked in 2001-07 in some mailing lists on how to disable GTK+ tearoff menus in a py-glade, non-GNOME application. Do you have a solution? I have the same problem :-( And I don't like tearoffs at all. I don't have an answer yet. But a FAQ question has been posted: http://www.async.com.br/faq/pygtk/index.py?req=all#11.1 Ice cream to the first poster with an answer. Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] CList component
On Sun, 4 Nov 2001, Thierry Vic wrote: i would like to have a thing like: v = clist.get_items() print v [['row0 col0', 'row0 col1', 'row0 col2'], ['row1 col0', 'row1 col1', 'row1 col2'], ['row2 col0', 'row2 col1', 'row2 col2']] See http://www.async.com.br/faq/pygtk/index.py?req=all#13.3 Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] PyGtk Documentation
I remember people posting tutorial URLs to this list, but I can't seem to find them to add them to the FAQ. Can people please send them in again? And other documentation attempts? Is this what you were looking for? --- From: John Finlay [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: [pygtk] pygtk v1 tutorial Date: Wed, 05 Dec 2001 20:40:51 -0800 Sender: [EMAIL PROTECTED] X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.2-2 i686) While working my way through the GTK tutorial, I decided to rewrite it for PyGTK version 0.6.*. The result is at http://www.moeraki.com/pygtktutorial/index.html I added some pygtk specific info but it could use a lot more. I would like to get some review and comments to help improve it. Please check it out if you can. Thanks John --- From: Russell Nelson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [pygtk] pyglade-tutorial Date: Thu, 3 May 2001 14:57:54 -0400 (EDT) Sender: [EMAIL PROTECTED] X-Mailer: VM 6.43 under 20.4 Emerald XEmacs Lucid At http://russnelson.com/pyglade-tutorial, I have a tutorial on how to use Python, gtk, pygtk, glade, and libglade together to produce a simple application. --- From: Scott Prive [EMAIL PROTECTED] To: André Luís Lopes [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Subject: Re: [pygtk] PyGtk Documentation Date: Wed, 04 Apr 2001 19:24:20 -0400 Sender: [EMAIL PROTECTED] X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.4.2 i686) Hello Andre, There is no central location for PyGTK/PyGNOME documentation, and I have not seen a lot of tutorials. Try searching google.com linuxprogramming.com and other websites for not just pygtk, but also pygnome.. Here are two links: http://www.oreillynet.com/pub/a/python/2000/07/25/gnome_applet.html http://laguna.fmedic.unam.mx/~daniel/pygtutorial/pygtutorial/ and a great but incomplete (missing part 2) tutorial at: http://www.linuxfocus.org/English/July2000/article160.shtml If you have questions, another place besides this list you can get answers is by searching the mail list archives (I use Google for this). I don't know a lot about PyGTK myself... I joined this list, but have yet to spend a significant amount of time programming it, due to lack of time. Soon I will, however! :) -Scott --- ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] jpeg image viewing
On Mon, 14 Jan 2002, Neil Macneale wrote: Thats about all I know. I have a feeling that I am not showing things correctly. If I call show_all on the main window, it should show all of the children, and they will show their children, etc, right? Do I need to state that the pixmap is visible? Neil, I think you forgot to tell us what is going wrong in your application. :-) Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] FAQ work.
http://www.async.com.br/faq/pygtk/index.py?req=all Hi there, I've added about 20 questions (75% or so with answers) and updated the old ones. Most stuff has been pulled from the mailing list, so you might see some verbatim stuff there. If you don't want me to cite your name, or if I forgot to add it somewhere and you want credit, let me know. There are a couple of XXX: comments. Most of these I know but was too tired to test and get a definitive answer now. If anybody knows an answer and wants to send it in, either ask for the password or send in the change through email and i'll do it. Hopefully we'll start getting things in, and docs will be less patchy (as most stuff that comes to the list is a FAQ anyway, this might make list traffic go down somewhat :-). Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Tutorials
i've got three listed at the bottom of this (unfinished) page: http://sjbrown.geeky.net/metagame-sector/tutorial.html sjbrown On Thu, 2002-01-31 at 16:31, Christian Robottom Reis wrote: I remember people posting tutorial URLs to this list, but I can't seem to find them to add them to the FAQ. Can people please send them in again? And other documentation attempts? Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk signature.asc Description: This is a digitally signed message part
[pygtk] FAQ
Fixed. Thanks. http://www.async.com.br/faq/pygtk/index.py?req=all#1.9 Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Tutorials
Here's another one http://www.icon.co.za/~zapr/Project1.html I'd be interested in getting a password to add stuff to the FAQ myself. sjbrown On Thu, 2002-01-31 at 16:31, Christian Robottom Reis wrote: I remember people posting tutorial URLs to this list, but I can't seem to find them to add them to the FAQ. Can people please send them in again? And other documentation attempts? Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk signature.asc Description: This is a digitally signed message part
Re: [pygtk] Tutorials
On 31 Jan 2002, Shandy Brown wrote: Here's another one http://www.icon.co.za/~zapr/Project1.html I'd be interested in getting a password to add stuff to the FAQ myself. You can add that one to the FAQ itself so you get the hang of it. pie-gtk Thanks :-) Take care, -- Christian Reis, Senior Engineer, Async Open Source, Brazil. http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk