[pygtk] Announcement: pygtk2 for windows
Hi I have managed to compile pygtk-1.99.7 on windows. Files can be found at: http://www-ai.ijs.si/~kese/python/ Warning: Consider this as an alpha release as the software is not very stable yet. The archive includes binary pyhton modules as well as required MSVC makefiles (if you wish to build it yourself). The binaries have been built on the current CVS (March 16, 2002) version of pygtk and the Tor Lillquist's port of Gtk+-2.0 to windows (see http://www.gimp.org/~tml/gimp/win32/). There are no bindings for glade, nor gtkgl. Sources had to be slightly modified in order to build on windows. Here is a quick description of modifications: - gtk/gtkmodule.c: init_gtk A call to gtk_init_check(...) segfaults whenever any arguments are passed to gtk. I have replaced the call with the following code (so that the arguments are being ignored): #ifdef _WIN32 if (!gtk_init_check(0, NULL)) { #else if (!gtk_init_check(argc, argv)) { #endif if (argv != NULL) { - gtk/gtk.defs and gtk/gtk-types.defs All references to GtkSocket and GtkPlug have been removed because GtkSocket and GtkPlug are only available in libgtk-x11 (on X windows). - gtk/gtk.c: _wrap_gtk_widget__get_allocation(...) There was a small bug in CVS version of pygtk that should be resolved quickly (probably an autogeneration problem). Anyway I have replaced: return pyg_boxed_new(ret, FALSE, TRUE); with: return pyg_boxed_new(GDK_TYPE_RECTANGLE, ret, FALSE, TRUE); -- That is about it. You are invited to play with it and help with debugging. Best luck, Peter P.S. I would appreciate if any of this would be included into the original pygtk CVS or distribution. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] EXPLAIN: _wrap_get_selection_data__get_data
James Henstridge wrote: Please report any compatibility problems w.r.t. pygtk on windows at http://bugzilla.gnome.org/ (product=gnome-python). If possible, I would like 2.0 to build out of the box on windows. Sure thing! In the meanwhile, I have successfuly built pygtk on windows using Tor Lillqvist's DLLs. I will give it another try with the CVS version of pygtk tomorrow, clean up the stuff and then send you required files (makefiles) and patches in the following days. Peter ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] EXPLAIN: _wrap_get_selection_data__get_data
Hi all! I am porting pygtk to windows and have made quite some progress in one afternoon. There is however something that MS Visual C won't compile and even I don't know what that *thing* was supposed to be. Can anyone explain the code and help me make it compilable. Here it is (an excerpt from gtk.c)... --- static PyObject * _wrap_gtk_selection_data_getattr(PyObject *self, char *attr) { if (!strcmp(attr, __members__)) return Py_BuildValue([s], selection, target, type, format, data); ... ... if (!strcmp(attr, data)) { static PyObject * _wrap_gtk_selection_data__get_data(PyGObject *self, void *closure) { if (pyg_boxed_get(self, GtkSelectionData)-length = 0) { return PyString_FromStringAndSize( pyg_boxed_get(self, GtkSelectionData)-data, pyg_boxed_get(self, GtkSelectionData)-length); } else { Py_INCREF(Py_None); return Py_None; } } } return Py_FindMethod(_PyGtkSelectionData_methods, self, attr); } -- The compiler stops at line _wrap_gtk_selection_data__get_data(PyGObject *self, void *closure) and says there should be a ';' before the next opening brace. To me it seems, there is a whole function being embedded into a block of code instead of just a call to that function. Thanks, Peter ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
[pygtk] How to delete Gtk objects
Hi! I am having some problems with reference counting and grabage collection (or it could actually be just, that I don't understand how things work in pygtk). I there is a small chunk of code for pygtk-1.99.3: import gtk class MyLabel(gtk.Label): def __del__(self): print MyLabel deleted. label = MyLabel('foo') del(label) Presumably when label is deleted, its __del__ method should get called. But it doesn't. When and how should I use unref(), sink() and other methods? How and when do PyGtk objects ever get deleted. Peter ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] problems building 1.99.* - 'Could not write method...'
Elliot Lee wrote: On Thu, 4 Oct 2001, Peter Kese wrote: gtk.c: In function `_wrap_gtk_tree_view_set_cursor': gtk.c:12686: too few arguments to function `gtk_tree_view_set_cursor' make[2]: *** [gtk.lo] Error 1 Make sure you have gtk 1.3.9, and the latest of all the associated packages. Otherwise, no clue. -- Elliot I guess I have the latest versions: $ rpm -q glib2 glib2-1.3.9-1 $ rpm -q gtk2 gtk2-1.3.9-1 $ rpm -q pango pango-0.20-1 $ rpm -q atk atk-0.5-1 Thanks anyway, Peter ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] problems building 1.99.* - 'Could not write method...'
Elliot Lee wrote: On Wed, 3 Oct 2001, Peter Kese wrote: Could not write method GtkTextIter.get_attributes ... and so on Those are not really error messages that cause compilation to fail. Finaly the C compiler reports bugs while trying to compile gtk.c. You need to give details here... -- Elliot Here is a more complete makefile log... [peter@dent pygtk-1.99.2-py22]$ make make all-recursive make[1]: Entering directory `/home/peter/build/pygtk-1.99.2-py22' Making all in codegen make[2]: Entering directory `/home/peter/build/pygtk-1.99.2-py22/codegen' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/peter/build/pygtk-1.99.2-py22/codegen' Making all in gtk make[2]: Entering directory `/home/peter/build/pygtk-1.99.2-py22/gtk' chmod a+w . cd . \ /usr/bin/python ../codegen/codegen.py \ --register ../pango.defs \ --register gdk.defs \ --override gtk.override \ --prefix pygtk gtk.defs gen-gtk.c \ cp gen-gtk.c gtk.c \ rm -f gen-gtk.c Could not write method GtkTextIter.get_attributes Could not write method GtkTextIter.forward_find_char Could not write method GtkTextIter.backward_find_char ... some lines missing... ... Could not write function gtk_tree_row_reference_reordered Could not write function type_class Could not write function window_list_toplevels source='gtk.c' object='gtk.lo' libtool=yes \ depfile='.deps/gtk.Plo' tmpdepfile='.deps/gtk.TPlo' \ depmode=gcc /bin/sh ../depcomp \ /bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/include/python2.2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/atk-1.0 -Wall-g -O2 -c -o gtk.lo `test -f gtk.c || echo './'`gtk.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/include/python2.2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/atk-1.0 -Wall -g -O2 -c gtk.c -Wp,-MD,.deps/gtk.TPlo -fPIC -DPIC -o gtk.lo gtk.c: In function `_wrap_gtk_tree_view_column_new': gtk.c:5798: warning: implicit declaration of function `gtk_tree_view_column_set_cell_renderer' gtk.c: In function `_wrap_gtk_container_queue_resize': gtk.c:12142: warning: implicit declaration of function `gtk_container_queue_resize' gtk.c: In function `_wrap_gtk_container_clear_resize_widgets': gtk.c:12155: warning: implicit declaration of function `gtk_container_clear_resize_widgets' gtk.c: In function `_wrap_gtk_container_child_composite_name': gtk.c:12174: warning: implicit declaration of function `gtk_container_child_composite_name' gtk.c:12174: warning: assignment makes pointer from integer without a cast gtk.c: In function `_wrap_gtk_tree_view_set_cursor': gtk.c:12686: too few arguments to function `gtk_tree_view_set_cursor' make[2]: *** [gtk.lo] Error 1 make[2]: Leaving directory `/home/peter/build/pygtk-1.99.2-py22/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/peter/build/pygtk-1.99.2-py22' make: *** [all] Error 2 [peter@dent pygtk-1.99.2-py22]$ After I have tried to uncomment tracebacks in codegen.py I got: Could not write method GtkTextIter.get_attributes Traceback (most recent call last): File ../codegen/codegen.py, line 657, in write_boxed write_boxed_method(boxedobj.c_name, meth, fp) File ../codegen/codegen.py, line 534, in write_boxed_method handler = argtypes.matcher.get(ptype) File ../codegen/argtypes.py, line 481, in get return self.argtypes[ptype] KeyError: GtkTextAttributes* Could not write method GtkTextIter.forward_find_char Traceback (most recent call last): File ../codegen/codegen.py, line 657, in write_boxed write_boxed_method(boxedobj.c_name, meth, fp) File ../codegen/codegen.py, line 534, in write_boxed_method handler = argtypes.matcher.get(ptype) File ../codegen/argtypes.py, line 481, in get return self.argtypes[ptype] ... Could not write method GtkCellRenderer.get_size Traceback (most recent call last): File ../codegen/codegen.py, line 442, in write_class write_method(objobj.c_name, castmacro, meth, fp) File ../codegen/codegen.py, line 306, in write_method handler = argtypes.matcher.get(ptype) File ../codegen/argtypes.py, line 481, in get return self.argtypes[ptype] KeyError: gint* So I checked to see what is going on in artypes.py code and it appears, that in method ArgMatcher.get(self,ptype), several types are not defined in the argtypes dictionary. Here is the list: argtype not found AtkObject* argtype not found char** argtype not found const-GParamSpec* argtype not found const-GtkIconSource* argtype not found const
[pygtk] problems building 1.99.* - 'Could not write method...'
Hi! Ever since I have upgraded my Gtk+ to 1.3.9, I am encountering problems when trying to build pygtk (versions 1.99 to 1.99.2-py22). The problems arises while generating file gtk.c (gtk-gen.c): ... chmod a+w . cd . \ /usr/bin/python ../codegen/codegen.py \ --register ../pango.defs \ --register gdk.defs \ --override gtk.override \ --prefix pygtk gtk.defs gen-gtk.c \ cp gen-gtk.c gtk.c \ rm -f gen-gtk.c Could not write method GtkTextIter.get_attributes Could not write method GtkTextIter.forward_find_char Could not write method GtkTextIter.backward_find_char Could not write method GtkSelectionData.get_text Could not write method GtkSelectionData.get_tree_row Could not write method GtkIconFactory.add ... and so on Finaly the C compiler reports bugs while trying to compile gtk.c. Can someone please help me fix these issues? Thanks, Peter P.S. Does this have anything to do with the gdk.override, EXTRA_DIST and gtk/Makefile.am issue. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] GdkPixbuf on win32
Hi! Can anyone suggest me, how to get GdkPixbuf working on Windows. I have found out that the pygtk-0.6.8 has it, but there is no port to Windows. Does this mean I would have to build it (including glib/gtk+) myself? Can anyone give me a few hints on that topic or even on building process. For example how to get makefile.msc from makefile.msc.in on windows without using the configure script (I guess that tells enough about the level I am at;) Thanks, Peter ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] Python 2.1 / Gtk+ 2.0
Hi! I am planning a project based on pygtk in which I am planning to use Python 2.1 NumPy 18.0 - makes use of new Python 2.1 features PyGtk - as I need to be portable to Unix and Windows GdkPixbuf As it is probably going to take me months to complete it, I thought it might be wise to start the project with Gtk 1.4 or 2.0. Therefore I am wondering: 1) are there any PyGtk for Gtk 1.4 / 2.0 beta available, (when, how) 2) does PyGtk 0.6.X compile with Python 2.1 Thanks, Peter ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk