diff options
Diffstat (limited to 'README')
-rw-r--r-- | README | 156 |
1 files changed, 26 insertions, 130 deletions
@@ -10,12 +10,15 @@ useful, and is usable to write moderately complex programs. (see the examples directory for some examples of the simpler programs you could write). -If you have any enhancements or bug reports, please send them to me at -james@daa.com.au. If you are going to send me diffs, my prefered -format is unified diff (ie. diff -u), followed by context diffs. -Please don't send me diffs which don't have any context, as these are -almost useless if I try to apply them manually, or have a different -version of the source tree. +If you have any enhancements or bug reports, please file them in +bugzilla at: + http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-python&component=pygtk + +If you have a patch, file the bug first and then use the "create new +attachment" link on the bug's info page. My preferred format for +patches is unified diff format (ie. diff -u). Please don't send me +diffs which don't have any context, as these make it very difficult to +see what the patch does. New Versions @@ -23,16 +26,15 @@ New Versions New versions of this package can be found at: ftp://ftp.gtk.org/pub/gtk/python/ - ftp://ftp.daa.com.au/pub/james/python/ - ftp://ftp.python.org/pub/contrib/Graphics/ + http://ftp.gnome.org/pub/GNOME/sources/pygtk/ Mailing list ============ -There is a mailing list for pygtk. You can subscribe to it by sending mail -to pygtk-request@daa.com.au with the word subscribe in the body. The list -address is pygtk@daa.com.au. +There is a mailing list for pygtk. You can subscribe to it through +the web interface: + http://www.daa.com.au/mailman/listinfo/pygtk Copyright Information @@ -73,11 +75,6 @@ installs to the site-packages directory (using prefix and exec_prefix where appropriate). It also compiles .pyc and .pyo files from the python code. -If you had a copy of gdk_imlib installed on your system (and configure -could find it) when you built pygtk, a wrapper for it will have been -installed with the main pygtk modules. A simple example of using the -GdkImlib module is in the directory examples/imlib. - If you have trouble with building or installing any of the code, please tell me -- it is the only way I can fix the problem. If you do mail me, please put something sensible in the subject line so I can tell what it @@ -87,125 +84,25 @@ is about. Upgrading ========= -Note that from version 0.5.0 up, pygtk uses GTK >= 1.2. Since there -were some changes to the API, pygtk has changed accordingly. The main -one that will cause problems is the GtkAcceleratorTable. In this -version, it has been removed and replaced with the GtkAccelGroup. -Also note that some of the functions that refer to that type may have -changed slightly. The rest of the changes are mostly invisible, since -they are mainly internal, and not touched upon by most people's code. - -The Gtkinter module has been renamed to gtk.py, which is more consistent -with the rest of the module, and the GNOME stuff. - -Also, I have changed the arguments for the gtk.new function. Now -instead of object arguments being passed in as a dictionary, they are -passed in as keyword arguments. This is possible because the 'Gtk*::' -prefix is no longer needed. - -If you have a previous 0.5.x version of pygtk, and you weren't using -the Gtkinter.py wrapper, there is no _gtkbase module any more, so -don't include it. Also don't call pygtk_init, as it is now done -automatically during module initialisation. +The API has changed a fair bit compared to the 0.6.x releases of pygtk +in response to feedback from the mailing list. The main changes are: + - no low level procedural interface. The extension now implements + the object oriented API directly, rather than layering it on top + of a procedural API. + - class names have been shortened. Eg. instead of gtk.GtkWindow, we + now have gtk.Window. + - GDK classes and functions have been moved to the "gtk.gdk" module. + - the GTK and GDK modules have been removed, with their constants + being moved into the "gtk" and "gtk.gdk" modules. Tests ===== -After having compiled and installed gtkmodule, GTK and Gtkinter, you -may want to test them. In the examples directory there are a number -of programs you may want to use to test gtkmodule and Gtkinter. These -programs rely on being able to find gtkmodule, GTK and Gtkinter, so -you must have installed them somewhere on your python path. (Typing -"PYTHONPATH=../.. python filename.py" from the examples directory is -enough, after building gtkmodule) - - -_gtkmodule and GTK.py -==================== - -Using the non object oriented interfaces of pygtk is not really -supported and the interfaces will disapear with the 0.7.x series, as I -am switching over to using ExtensionClass, so the C wrappers will be -object oriented without the python class wrappers. - -This module contains an almost complete translation of the functions -in the gtk library. To start up, put in the command "from _gtk import -*". If you want to use any of the constants, type "from GTK import -*". The constants all have the "GTK_" removed from the start. Before -creating any GtkObjects, you should execute the command "gtk_init()". -Unlike the C equivalent, you don't have to specify an argument list, -since there are other ways to get at it. - -When you are using the functions in this module, you will find that -there is no need to use any of the type casting macros on GtkObjects, -since they are all stored inside the same python type. Each function -in the module does its own type casting. - -In this module there are only two signal connection functions -- -gtk_signal_connect and gtk_signal_connect_after. The other functions -can be emulated with the use of callable class instances wrapped -around the signal handler. Also signal handlers are not parsed the -extra data argument. The reason for this is because the code has to -keep track of both the python signal handler and its C wrapper. - -In the gtk_object_new and gtk_object_set functions, the property -setting argumetns have been compressed into a single dictionary as an -argument. This dictionary has string keys that correspond to the -property names, and the values are the property values. The reason -that I did not use keyword arguments is that things like -"GtkWindow::title" are not valid keywords, so unfortunately we have to -use this clumsy syntax. - - -gtk.py -=========== - -This module is a wrapper for gtkmodule. You start using it by -executing the command "from gtk import *". This will give you -access to all of Gtkinter, and also import GTK, the constants module, -for you. - -This module implements an object oriented wrapper for gtk. Probably -the best way to get a feel for it, is to read some of the source -code. Basically, there is a class for each GtkObject type. Each -class implements the functions specific to that GtkObject type as -methods. (ie. GtkWidget.show() is equivalent to gtk_widget_show()). - -The classes are set up such that their inheritance tree matches that -of the actual GtkObjects. This means that you can call -GtkWidget.show() from a GtkWindow class instance. +After having compiled and installed pygtk, you may want to test them. +There are a number of example programs available in the examples/ +subdirectory. -The constructors for each of these classes corresponds to the -gtk_*_new functions. Through the use of default arguments, both the -gtk_*_new and gtk_*_new_* functions are both supported through the -constructor. - -The drag and drop functions gtk_drag_* map to GtkWidget.drag_*, and the -selection functions gtk_selection_* map to GtkWidget.selection_*. - -There are also a few extra functions in Gtkinter. These are new(), -mainloop() and mainquit(). The function new() implements -gtk_object_new. It's first argument can be either a string, or one of -the classes in the module. The second argument is a dictionary that -is almost passed to gtk_object_new after converting Gtkinter Objects -to GtkObjects. - -The function mainloop() is basically just the function gtk_main(), and -the function mainquit is equivalent to gtk_main_quit(). - -For further information on the interface, please see the source file -gtk.py. - -For a more in depth look at the mapping of the C GTK functions to -python, read the file MAPPING that is distributed with this package. - - -Should I Use _gtkmodule or gtk.py? -=================================== - -For any new programs, use the interfaces in gtk.py. The function -based interface will be disapearing in a later release. Contacting the Author ===================== @@ -215,4 +112,3 @@ answer my email quickly, but occasionally there will be a bit of a delay. If you have an idea for a way to extend GTK, have found a problem with the code, or would like to contribute some code, please feel free to contact me. - |