Porting between different versions of Pmw

This document contains a brief guide to porting existing code between different versions of Pmw. It includes significant functionality changes but does not include bug fixes or compatible enhancements. For details of all changes, see Changes to Pmw versions.

Porting from 0.8.5 to 1.0, 1.1 and 1.2

Porting from 0.8.4 to 0.8.5

Porting from 0.8.3 to 0.8.4

Porting from 0.8.1 to 0.8.3

Porting from 0.8 to 0.8.1

Porting from 0.7 to 0.8

Porting from 0.6 to 0.7

Porting from 0.5 to 0.6

To port applications using Pmw version 0.5 to version 0.6, make sure you are using python1.5. Then, simply change any lines in your application like this:

 from PmwLazy import Pmw

to this:

 import Pmw

Also, if you have added the lib directory of a specific version of Pmw to sys.path or PYTHONPATH, this can be removed, as long as Pmw can now be found from the default path, such as in the python site-packages directory.

Porting from 0.2 to 0.4

class MyBigWidget(Pmw.MegaWidget):
    def __init__(self, parent = None, **kw):

        # Define the megawidget options.
        optiondefs = (
            ('errorbackground',   'pink',      None),
            ('maxwidth',          0,           self._myfunc),
            ('myinit',            'good',      Pmw.INITOPT),
        )
        self.defineoptions(kw, optiondefs)

        # Initialise the base class (after defining the options).
        Pmw.MegaWidget.__init__(self, parent)

        # Create the components.
        interior = self.interior()
        self._widget = self.createcomponent('component',
                (('alias', 'component_alias'),), None,
                Tkinter.Button, (interior,))
        self._widget.grid(column=0, row=0, sticky='nsew')

        self.createlabel(interior)

        # Initialise instance variables.
        self.deriveddummy = None

        # Check keywords and initialise options.
        self.initialiseoptions(MyBigWidget)

Pmw 1.2 - 5 Aug 2003 - Home