Re: [pygtk] new pygtk for gtk 2.0 snapshot
James This is a known problem or modify python to pass the James RTLD_GLOBAL flag when dlopen'ing extensions. James The second option is easier (Red Hat has a patch to do it in James their python rpms), Any pointers to RedHat's RTLD_GLOBAL patch would be appreciated. I couldn't find it via their search mechanisms. Thanks, -- Skip Montanaro ([EMAIL PROTECTED]) (847)971-7098 ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] new pygtk for gtk 2.0 snapshot
On Tue, 17 Apr 2001, Skip Montanaro wrote: Any pointers to RedHat's RTLD_GLOBAL patch would be appreciated. I couldn't find it via their search mechanisms. It's not the correct fix, but anyway.. I guess you know that already. This was discussed and Guido himself said it was not a reasonable solution. Take care, -- /\/\ Christian Reis, Senior Engineer, Async Open Source, Brazil ~\/~ http://async.com.br/~kiko/ | [+55 16] 274 4311 --- Python-1.5.2/Python/importdl.c.global Sat Jul 17 16:52:26 1999 +++ Python-1.5.2/Python/importdl.c Sat Jul 17 16:53:19 1999 @@ -441,13 +441,13 @@ #ifdef RTLD_NOW /* RTLD_NOW: resolve externals now (i.e. core dump now if some are missing) */ - void *handle = dlopen(pathname, RTLD_NOW); + void *handle = dlopen(pathname, RTLD_NOW | RTLD_GLOBAL); #else void *handle; if (Py_VerboseFlag) printf("dlopen(\"%s\", %d);\n", pathname, - RTLD_LAZY); - handle = dlopen(pathname, RTLD_LAZY); + RTLD_LAZY | RTLD_GLOBAL); + handle = dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL); #endif /* RTLD_NOW */ if (handle == NULL) { PyErr_SetString(PyExc_ImportError, dlerror());
Re: [pygtk] new pygtk for gtk 2.0 snapshot
On Tue, 17 Apr 2001, Skip Montanaro wrote: James This is a known problem or modify python to pass the James RTLD_GLOBAL flag when dlopen'ing extensions. James The second option is easier (Red Hat has a patch to do it in James their python rpms), Any pointers to RedHat's RTLD_GLOBAL patch would be appreciated. I couldn't find it via their search mechanisms. Don't have an exact reference (the patch is probably in their source rpms). The change is very simple. Just edit Python/dynload_shlib.c, and find the call to dlopen close to the bottom of the file. The second argument to dlopen() is a set of flags. You can just or RTLD_GLOBAL against the flags. That is, changing the line: handle = dlopen(pathname, RTLD_NOW); to: handle = dlopen(pathname, RTLD_NOW | RTLD_GLOBAL); (there is no reason to change the second dlopen call, as Linux systems have the RTLD_NOW flag). The effect of this is that loaded extension modules can see each other's symbols (plus the symbols of any other libraries pulled in by shared library dependencies). This could potentially cause symbol conflicts, but in practice doesn't cause problems very often (most extensions only export a single function -- the initmodulename() function. I have some patches that fix the dynamic dependencies in glib, pango and gtk+ (the gtk+ patch still isn't perfect -- the depdendencies for the gdk-pixbuf modules are not quite right yet). They make use of features in libtool-1.3d (a beta release of 1.4). You can find the current set of patches attached to this bugzilla bug: http://bugzilla.gnome.org/show_bug.cgi?id=50707 At the moment, it is probably easier to patch python rather than gtk. Owen says he doesn't want to switch the official gtk packages to the newer libtool until libtool-1.4 is released. James. -- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] pixbuffer
Hi all, Someone can help me to create a pixbuf from a 16bits buffer or load raw datas from a file? thanx in advance ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] GtkHTML
I would like to use the GtkHTML widget to create a simple editable text space that can use HTML styles. Is this possible? I know that Ximian Evolution uses GtkHTML as the editor widget for the composer. Can I utilize this functionality from python? If not, are there plans for such bindings? Thanks in advance, Jon ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] How to create a menu ?
Hi all I'm trying to create a menu for my application with tje following code : ==cutting the def's mainwindow = GtkWindow(WINDOW_TOPLEVEL, title="Test") mainwindow.set_border_width(5) mainwindow.set_default_size(800,600) mainwindow.connect("destroy", close_program) # Main box vbox = GtkVBox() mainwindow.add(vbox) vbox.show() # Our menubar ... menubar = GtkMenuBar() vbox.pack_start(menubar, expand=FALSE) menubar.show() # ... our menues ... filemenu = GtkMenuItem("File") menubar.append(filemenu) filemenu.show() = cutting here === How could I insert items inside the filemenu ? I think I need to create a item like : myitem = GtkMenu() And to tell filemenu that myitem is it's submenu, like that : filemenu = GtkMenuItem("File") filemenu.set_submenu(myitem) menubar.append(filemenu) filemenu.show() But it isn't working. How could I do that ? And where I set my myitem content ? Also, wich signal I should used with a menu ? I tried "clicked" but an error message saying that GtkMenu() doesn't has a "clicked" signal appears. Well, that's all for now. Regards -- Andr Lus Lopes Utah Linuxcenter [EMAIL PROTECTED] http://www.utah.com.br ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] gdk-pixbuf bindings
Is anybody working on them? Would they be accepted into gnome-python? -- http://www.penguinpowered.com/~vii ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] GTKExtra for win32
Hi I'v just installed python 2.0 for win32 and pygtk for win32. It seems to work now. I want to write easly portable program in python, but it is rather difficult anyway. I'd like to use some extra (GtkExtra) widgets with python, and it is possible only under linux. There is no easy way to make it work under win32. So may questions are: - is there port of GtkExtra for win32? - is there port of python bindings for GtkExtra for win32? Under w98 I even couldn't run testgtk.py (from pygtk examples) because of lack of GtkEXtra ;-(. Well, don't you think, that there is something missing in this portability problem? BTW. From pygtk examples I was able ro run all *2.py programs (ie hello2.py) but not *1.py (ie hello1.py). The error was: unable to find DLL... Is it normal? I use gtk dlla from the latest port of gimp1.2 for win32 (they are 1.3 gtk=unstable - why?). Regards Piotr Legiecki ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] deriving classes from gtk.py
Skip Montanaro [EMAIL PROTECTED] writes: Tim hi, Tim i'd like to use pygtk widget classes as base classes to my own, like Tim class myVBox (GtkVBox): Tim ... Tim now if i understand correctly, the python wrapping code in gtk.py Tim is planned to be rewritten in c. will this break code like above? I believe it should work. The new version uses Digital Creations' ExtensionClass to allow objects to be subclassed in Python. However, IIRC, calling a baseclass' method in a method has to be done slightly different. E.g. class MyBox(GtkBaseClass): def __init__(self): GtkBaseClass.__init__(self) will fail because type(self) isn't InstanceType. James pointed out some other pifalls in http://www.daa.com.au/pipermail/pygtk/2000-June/000104.html AFAIK, the reason to use ExtensionClasses in the first place was to make sure that there is exactly one pygtk object for every GTK widget. Without ExtensionClasses you get circular references. In Python 2.1 there'll be weak references which would provide a solution for this problem. Wouldn't it make more sense to rely on that? Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://mapit.de/ ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] Handling globals in a big project
I'm working on a a fairly complex GUI application: lots of screens and dialogs and lots of data to keep track of. My instinct is to organize my work into files - one file for the implementation of each major ui element. There are a several (quite a few, actually) data structures that are needed all over the place, so it seems natural to treat them as globals, initialized in the main application file. My question is the what is the best (and most python-esque) way to do this. Right now i'm doing something like this main_file.py import dialog1 datastruct1 = "foo" dialog1.create("blah blah blah") dialog1.py from sys import modules datastruct1 = modules["__main__"].datastruct1 def create(data): global datastruct1 do_stuff(datastruct1, data) This works, but importing toplevel data through sys.modules seems so inelegant. Is there a better way or standard python idiom for doing this? Jay ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] GtkHTML
On 2 Apr 2001, Jonathan LaCour wrote: I would like to use the GtkHTML widget to create a simple editable text space that can use HTML styles. Is this possible? I know that Ximian Evolution uses GtkHTML as the editor widget for the composer. Can I utilize this functionality from python? If not, are there plans for such bindings? I haven't done the bindings for the GtkHTML interfaces used for editing yet (they aren't the cleanest interfaces I have seen). I am taking patches though :) James. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] How to create a menu ?
On Tue, 3 Apr 2001, Andre Luis Lopes wrote: Hi all I'm trying to create a menu for my application with tje following code : 1) Create a GtkMenuBar widget 2) add GtkMenuItem widget to menubar 3) create GtkMenu widget 4) use menuitem.set_submenu(menu) to associate the menu with the menuitem 5) create GtkMenuItems and add them to the GtkMenu Alternatively you can use the GtkItemFactory object, which does all this for you. Take a look at some of the examples distributed with gtk for details. James. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] gdk-pixbuf bindings
On 7 Apr 2001, John Fremlin wrote: Is anybody working on them? Would they be accepted into gnome-python? I have some half complete bindings in CVS right now, and they will be in the next release. James. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk