異なるバージョンの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.
この文書は既にあるPmwを使うPythonプログラムを異なるバージョンのPmwへ移植する際の簡単なガイドである。この文書では主要な機能の変更については述べているが、バグフィックスや互換な機能の増強については触れていない。すべての変更のしょうさいについては、Changes to Pmw versions.を参照されたい。

Porting from 0.8.3 to 0.8.4(0.8.3から0.8.4への移植)

Porting from 0.8.1 to 0.8.3(0.8.1から0.8.3への移植) Porting from 0.8 to 0.8.1(0.8から0.8.1への移植) Porting from 0.7 to 0.8(0.7から0.8への移植) Porting fom 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)

Home. Pmw 0.8.4 Maintainer gregm@iname.com. 12 May 2000