Pmw.1.3.2/0000755000175000017500000000000010675673460011437 5ustar serge2serge2Pmw.1.3.2/src/0000755000175000017500000000000010655462400012212 5ustar serge2serge2Pmw.1.3.2/src/setup.py0000755000175000017500000000273010675672672013751 0ustar serge2serge2#!/usr/bin/env python # setup.py from distutils.core import setup setup(name="Pmw", version='1.3.2', description = 'Python Mega Widgets', author="Telstra Corporation Limited, Australia", author_email="", url='http://pmw.sourceforge.net/', package_dir = { "Pmw":"Pmw"}, packages=['Pmw', 'Pmw.Pmw_1_3', 'Pmw.Pmw_1_3.lib',], package_data={'Pmw': ['Pmw_1_3/lib/Pmw.def', 'Pmw_1_3/doc/*', 'Pmw_1_3/contrib/*', 'Pmw_1_3/demos/*', 'Pmw_1_3/tests/*', 'Pmw_1_3/bin/*', ] }, license='BSD', long_description='''Pmw is a toolkit for building high-level compound widgets, or megawidgets, constructed using other widgets as component parts. It promotes consistent look and feel within and between graphical applications, is highly configurable to your needs and is easy to use.''', classifiers = [ 'Development Status :: Alpha', 'Environment :: Console', 'Intended Audience :: End Users/Desktop', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: BSD', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python', 'Topic :: GUI', ], ) Pmw.1.3.2/src/Pmw/0000755000175000017500000000000010655462400012755 5ustar serge2serge2Pmw.1.3.2/src/Pmw/__init__.py0000644000175000017500000000262710656147112015076 0ustar serge2serge2# This file is executed when the Pmw package is imported. It creates # a lazy importer/dynamic loader for Pmw and replaces the Pmw module # with it. Even though the loader from the most recent installed # version of Pmw is used, the user is able to specify which version of # Pmw megawidgets to load by using the setversion() function of the # loader. # This is the only file in Pmw which is not part of a particular Pmw # release. import sys import os import re def _hasLoader(dir): # Only accept Pmw_V_R_P with single digits, since ordering will # not work correctly with multiple digits (for example, Pmw_10_0 # will be before Pmw_9_9). if re.search('^Pmw_[0-9]_[0-9](_[0-9])?$', dir) is not None: for suffix in ('.py', '.pyc', '.pyo'): path = os.path.join(_dir, dir, 'lib', 'PmwLoader' + suffix) if os.path.isfile(path): return 1 return 0 # First get a list of all subdirectories containing versions of Pmw. _dir = __path__[0] _listdir = os.listdir(_dir) _instdirs = filter(_hasLoader, _listdir) _instdirs.sort() _instdirs.reverse() # Using the latest version import the dynamic loader. _loader = 'Pmw.' + _instdirs[0] + '.lib.PmwLoader' __import__(_loader) _mod = sys.modules[_loader] # Create the dynamic loader and install it into sys.modules. sys.modules['_Pmw'] = sys.modules['Pmw'] sys.modules['Pmw'] = _mod.PmwLoader(_dir, _instdirs, _listdir) Pmw.1.3.2/src/Pmw/README0000644000175000017500000000060610656147112013640 0ustar serge2serge2 Python megawidgets Pmw is a toolkit for building high-level compound widgets in Python using the Tkinter module. All documentation about Pmw is in the form of html files stored in the 'doc' directory of each release of Pmw. Please use your Web browser to view the file 'doc/index.html' in the directory containing the most recent release. Pmw.1.3.2/src/Pmw/Pmw_1_3/0000755000175000017500000000000010655462400014162 5ustar serge2serge2Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/0000755000175000017500000000000010655462400014727 5ustar serge2serge2Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/refindex.html0000644000175000017500000001062710656147112017430 0ustar serge2serge2 Pmw reference manual index

Pmw reference manual
index

Base classes
Pmw.MegaArchetype Pmw.MegaWidget Pmw.MegaToplevel
Widgets
Pmw.ButtonBox Pmw.ComboBox Pmw.Counter Pmw.EntryField Pmw.Group Pmw.HistoryText Pmw.LabeledWidget Pmw.MainMenuBar Pmw.MenuBar Pmw.MessageBar Pmw.NoteBook Pmw.OptionMenu Pmw.PanedWidget Pmw.RadioSelect Pmw.ScrolledCanvas Pmw.ScrolledField Pmw.ScrolledFrame Pmw.ScrolledListBox Pmw.ScrolledText Pmw.TimeCounter
Dialogs
Pmw.AboutDialog Pmw.ComboBoxDialog Pmw.CounterDialog Pmw.Dialog Pmw.MessageDialog Pmw.PromptDialog Pmw.SelectionDialog Pmw.TextDialog
Miscellaneous
Pmw.Balloon Pmw.Blt Pmw.Color Module functions

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/AboutDialog.html0000644000175000017500000002332310656147112020013 0ustar serge2serge2 Pmw.AboutDialog reference manual

Pmw.AboutDialog

Name

Pmw.AboutDialog() - window to display version and contact information

Inherits

Pmw.MessageDialog

Description

An about dialog is a dialog window which displays information about the application, such as name, version, copyright and contact details.

The text of the message is constructed from the application name (given by the applicationname option) followed by the values supplied in the most recent calls to Pmw.aboutversion(), Pmw.aboutcopyright() and Pmw.aboutcontact() functions.

The icon of the message defaults to 'info', but may be changed using the icon_bitmap component option.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

applicationname
Initialisation option. The name of application, to be dispayed in the dialog body and in the window title if the title option is not given. The default is ''.

borderx
Initialisation option. The padding to the left and right of the text message and icon. The default is 20.

bordery
Initialisation option. The padding above and below the text message and icon. The default is 20.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('Close',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is 0.

iconmargin
Initialisation option. The padding between the text message and icon. The default is 20.

iconpos
Initialisation option. Specifies on which side of the text message to place the icon. Must be one of 'n', 's', 'e' or 'w'. The default is 'w'.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

icon
If the iconpos option is not None, this component is created to contain the icon label for the dialog. To display a bitmap as an icon, set the icon_bitmap component option to any of the forms acceptable to Tk, such as 'warning' or 'error'. By default, this component is a Tkinter.Label.

message
The label to contain the text message for the dialog. To set the text, use the message_text component option. By default, this component is a Tkinter.Label.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Methods

This megawidget has no methods of its own. For a description of its inherited methods, see the manual for its base class Pmw.MessageDialog.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create dialog.
        Pmw.aboutversion('9.9')
        Pmw.aboutcopyright('Copyright My Company 1999\nAll rights reserved')
        Pmw.aboutcontact(
            'For information about this application contact:\n' +
            '  My Help Desk\n' +
            '  Phone: +61 2 9876 5432\n' +
            '  email: help@my.company.com.au'
        )
        self.about = Pmw.AboutDialog(parent, applicationname = 'My Application')
        self.about.withdraw()

        # Create button to launch the dialog.
        w = Tkinter.Button(parent, text = 'Show about dialog',
                command = self.execute)
        w.pack(padx = 8, pady = 8)

    def execute(self):
        self.about.show()

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/Balloon.html0000644000175000017500000003774010656147112017217 0ustar serge2serge2 Pmw.Balloon reference manual

Pmw.Balloon

Name

Pmw.Balloon() - display "tool tips" for a number of widgets

Inherits

Pmw.MegaToplevel

Description

A balloon megawidget can be used to give short help messages to the user when they place the mouse over a button or other widget for a short time. It can also be used to display help messages for canvas or text items.

One balloon megawidget can be used to display help for many widgets or items. For each widget or item that requires balloon help, the bind() or bindtag() method is used to specify the help text that should be displayed.

The help message is displayed in a popup balloon window when the mouse remains over the widget or item for a short time. The popup balloon is withdrawn when the mouse leaves the widget or item, or any mouse buttons are pressed.

The position of the popup balloon is configurable and may appear either relative to the widget or item or relative to the position of the mouse.

The popup balloon is displayed without any window manager decorations.

The megawidget can cooperate with a Pmw.MessageBar to display a single-line help message as well as the balloon help.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

initwait
The number of milliseconds delay between when the mouse enters a widget or item and when the popup balloon window should be displayed. The default is 500.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

relmouse
This may be one of 'both', 'x', 'y' or 'none' and indicates that the top left corner of the popup balloon window should be placed relative to the current position of the mouse rather than relative to the bottom left corner of the widget or item (the default). The positioning may be set for the horizontal (x) and vertical (y) axes independently. The default is 'none'.

state
This may be one of 'both', 'balloon', 'status' or 'none' and indicates whether the help message should be displayed in the popup balloon window, in an associated messagebar (via the statuscommand option), or both. The default is 'both'.

statuscommand
This specifies a function to call when the mouse enters a widget or item bound to this balloon megawidget. To configure a Pmw.MessageBar to display help, set this option to the helpmessage method of the messagebar. The default is None.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

xoffset
This specifies the horizontal offset of the position of the left side of the popup balloon window relative the point determined by the relmouse option. The default is 20.

yoffset
This specifies the vertical offset of the position of the top of the popup balloon window relative the point determined by the relmouse option. The default is 1.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

label
This component displays the text of the help message in the popup balloon window. By default it is created with a 'lightyellow' background, a 'black' foreground and is 'left' justified. By default, this component is a Tkinter.Label.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaToplevel.

bind(widget, balloonHelp, statusHelp = None)
Create bindings for widget so that balloon help and/or status help is displayed when the mouse enters the widget. The balloon help message is given by balloonHelp and the status help message is given by statusHelp. If balloonHelp is None, no balloon is displayed. If statusHelp is not set, it defaults to balloonHelp. Any previous bindings for this widget are removed.

clearstatus()
Clear the text in the associated messagebar by passing None to the statuscommand function.

showstatus(statusHelp)
Set the text in the associated messagebar by passing statusHelp to the statuscommand function.

tagbind(widget, tagOrItem, balloonHelp, statusHelp = None)
Create bindings for the tag or item specified by tagOrItem in the text or canvas widget so that balloon help and/or status help is displayed when the mouse enters the tag or item. The balloon help message is given by balloonHelp and the status help message is given by statusHelp. If balloonHelp is None, no balloon is displayed. If statusHelp is not set, it defaults to balloonHelp. Any previous bindings for this tag or item are removed.

tagunbind(widget, tagOrItem)
Remove the balloon help bindings from the tag or item specified by tagOrItem in the text or canvas widget.

Note that tagunbind() must be called when deleting a canvas item, so that the popup balloon window can be withdrawn if it was triggered by the item. (Unfortunately this can not be automated as is done for widgets since Tk does not support <Destroy> bindings on canvas items, so there is no way that Pmw.Balloon can be notified of the deletion of an item.)

unbind(widget)
Remove the balloon help bindings from widget.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the Balloon.
        self.balloon = Pmw.Balloon(parent)

        # Create some widgets and megawidgets with balloon help.
        frame = Tkinter.Frame(parent)
        frame.pack(padx = 10, pady = 5)
        field = Pmw.EntryField(frame,
                labelpos = 'nw',
                label_text = 'Command:')
        field.setentry('mycommand -name foo')
        field.pack(side = 'left', padx = 10)
        self.balloon.bind(field, 'Command to\nstart/stop',
                'Enter the shell command to control')

        start = Tkinter.Button(frame, text='Start')
        start.pack(side='left', padx = 10)
        self.balloon.bind(start, 'Start the command')

        stop = Tkinter.Button(frame, text='Stop')
        stop.pack(side='left', padx = 10)
        self.balloon.bind(stop, 'Stop the command')

        self.suicide = Tkinter.Button(frame, text='Kill me soon!',
            command = self.killButton)
        self.suicide.pack(side='left', padx = 10)
        self.balloon.bind(self.suicide, 'Watch this button disappear!')

        scrolledCanvas = Pmw.ScrolledCanvas(parent,
                canvas_width = 300,
                canvas_height = 115,
        )
        scrolledCanvas.pack()
        canvas = scrolledCanvas.component('canvas')
        self.canvas = canvas

        # Create some canvas items and individual help.
        item = canvas.create_arc(5, 5, 35, 35, fill = 'red', extent = 315)
        self.balloon.tagbind(canvas, item, 'This is help for\nan arc item')
        item = canvas.create_bitmap(20, 150, bitmap = 'question')
        self.balloon.tagbind(canvas, item, 'This is help for\na bitmap')
        item = canvas.create_line(50, 60, 70, 80, 85, 20, width = 5)
        self.balloon.tagbind(canvas, item, 'This is help for\na line item')
        item = canvas.create_text(10, 90, text = 'Canvas items with balloons',
                anchor = 'nw', font = field.cget('entry_font'))
        self.balloon.tagbind(canvas, item, 'This is help for\na text item')

        # Create two canvas items which have the same tag and which use
        # the same help.
        canvas.create_rectangle(100, 10, 170, 50, fill = 'aliceblue',
                tags = 'TAG1')
        self.bluecircle = canvas.create_oval(110, 30, 160, 80, fill = 'blue',
                tags = 'TAG1')
        self.balloon.tagbind(canvas, 'TAG1',
                'This is help for the two blue items' + '\n' * 10 +
                    'It is very, very big.',
                'This is help for the two blue items')
        item = canvas.create_text(180, 10, text = 'Delete',
                anchor = 'nw', font = field.cget('entry_font'))
        self.balloon.tagbind(canvas, item,
                'After 2 seconds,\ndelete the blue circle')
        canvas.tag_bind(item, '<ButtonPress>', self._canvasButtonpress)
        scrolledCanvas.resizescrollregion()

        scrolledText = Pmw.ScrolledText(parent,
                text_width = 32,
                text_height = 4,
                text_wrap = 'none',
        )
        scrolledText.pack(pady = 5)
        text = scrolledText.component('text')
        self.text = text

        text.insert('end',
                'This is a text widget with ', '',
                ' balloon', 'TAG1',
                '\nhelp. Find the ', '',
                ' text ', 'TAG1',
                ' tagged with', '',
                ' help.', 'TAG2',
                '\n', '',
                'Remove tag 1.', 'TAG3',
                '\nAnother line.\nAnd another', '',
        )
        text.tag_configure('TAG1', borderwidth = 2, relief = 'sunken')
        text.tag_configure('TAG3', borderwidth = 2, relief = 'raised')

        self.balloon.tagbind(text, 'TAG1',
                'There is one secret\nballoon help.\nCan you find it?')
        self.balloon.tagbind(text, 'TAG2',
                'Well done!\nYou found it!')
        self.balloon.tagbind(text, 'TAG3',
                'After 2 seconds\ndelete the tag')
        text.tag_bind('TAG3', '<ButtonPress>', self._textButtonpress)

        frame = Tkinter.Frame(parent)
        frame.pack(padx = 10)
        self.toggleBalloonVar = Tkinter.IntVar()
        self.toggleBalloonVar.set(1)
        toggle = Tkinter.Checkbutton(frame,
                variable = self.toggleBalloonVar,
                text = 'Balloon help', command = self.toggle)
        toggle.pack(side = 'left', padx = 10)
        self.balloon.bind(toggle, 'Toggle balloon help\non and off')

        self.toggleStatusVar = Tkinter.IntVar()
        self.toggleStatusVar.set(1)
        toggle = Tkinter.Checkbutton(frame,
                variable = self.toggleStatusVar,
                text = 'Status help', command = self.toggle)
        toggle.pack(side = 'left', padx = 10)
        self.balloon.bind(toggle,
                'Toggle status help on and off, on and off' + '\n' * 10 +
                    'It is very, very big, too.',
                'Toggle status help on and off')

        # Create and pack the MessageBar.
        messageBar = Pmw.MessageBar(parent,
                entry_width = 40,
                entry_relief='groove',
                labelpos = 'w',
                label_text = 'Status:')
        messageBar.pack(fill = 'x', expand = 1, padx = 10, pady = 5)

        # Configure the balloon to display its status messages in the
        # message bar.
        self.balloon.configure(statuscommand = messageBar.helpmessage)

    def toggle(self):
        if self.toggleBalloonVar.get():
            if self.toggleStatusVar.get():
                self.balloon.configure(state = 'both')
            else:
                self.balloon.configure(state = 'balloon')
        else:
            if self.toggleStatusVar.get():
                self.balloon.configure(state = 'status')
            else:
                self.balloon.configure(state = 'none')

    def killButton(self):
        # Test for old bug when destroying widgets 1) while the
        # balloon was up and 2) during the initwait period.
        print 'Destroying button in 2 seconds'
        self.suicide.after(2000, self.suicide.destroy)

    def _canvasButtonpress(self, event):
        print 'Destroying blue circle in 2 seconds'
        self.canvas.after(2000, self.deleteBlueCircle)

    def deleteBlueCircle(self):
        self.balloon.tagunbind(self.canvas, self.bluecircle)
        self.canvas.delete(self.bluecircle)

    def _textButtonpress(self, event):
        print 'Deleting the text tag in 2 seconds'
        self.text.after(2000, self.deleteTextTag)

    def deleteTextTag(self):
        self.balloon.tagunbind(self.text, 'TAG1')
        self.text.tag_delete('TAG1')

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 20 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ButtonBox.html0000644000175000017500000002600710656147112017547 0ustar serge2serge2 Pmw.ButtonBox reference manual

Pmw.ButtonBox

Name

Pmw.ButtonBox() - manager megawidget for buttons

Inherits

Pmw.MegaWidget

Description

A button box is a container megawidget which manages a number of buttons. One of these buttons may be specified as the default and it will be displayed with the platform specific appearance for a default button. The buttons may be laid out either horizontally or vertically.

Options

Options for this megawidget and its base classes are described below.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

orient
Initialisation option. Specifies the orientation of the button box. This may be 'horizontal' or 'vertical'. The default is 'horizontal'.

padx
Initialisation option. Specifies a padding distance to leave between each button in the x direction and also between the buttons and the outer edge of the button box. The default is 3.

pady
Initialisation option. Specifies a padding distance to leave between each button in the y direction and also between the buttons and the outer edge of the button box. The default is 3.

Components

Components created by this megawidget and its base classes are described below.

frame
If the label component has been created (that is, the labelpos option is not None), the frame component is created to act as the container of the buttons created by the add() and insert() methods. If there is no label component, then no frame component is created and the hull component acts as the container. By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

Dynamic components

Button components are created dynamically by the add() and insert() methods. By default, the buttons are of type Tkinter.Button and are created with a component group of Button.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

add(componentName, **kw)
Add a button to the end of the button box as a component named componentName. Any keyword arguments present will be passed to the constructor when creating the button. If the text keyword argument is not given, the text option of the button defaults to componentName. The method returns the component widget.

alignbuttons(when = 'later')
Set the widths of all the buttons to be the same as the width of the widest button. If when is 'later', this will occur when the interpreter next becomes idle, otherwise the resizing will occur immediately.

button(buttonIndex)
Return the button specified by buttonIndex, which may have any of the forms accepted by the index() method.

delete(index)
Delete the button given by index from the button box. index may have any of the forms accepted by the index() method.

index(index, forInsert = 0)
Return the numerical index of the button corresponding to index. This may be specified in any of the following forms:

name
Specifies the button named name.

number
Specifies the button numerically, where 0 corresponds to the left (or top) button.

Pmw.END
Specifies the right (or bottom) button.

Pmw.DEFAULT
Specifies the current default button.

If forInsert is true, Pmw.END returns the number of buttons rather than the index of the last button.

insert(componentName, beforeComponent = 0, **kw)
Add a button to the button box as a component named componentName. The button is added just before the button specified by beforeComponent, which may have any of the forms accepted by the index() method. Any keyword arguments present will be passed to the constructor when creating the button. If the text keyword argument is not given, the text option of the button defaults to componentName. To add a button to the end of the button box, use add(). The method returns the component widget.

invoke(index = Pmw.DEFAULT, noFlash = 0)
Invoke the callback command associated with the button specified by index and return the value returned by the callback. Unless noFlash is true, flash the button to indicate to the user that something happened. index may have any of the forms accepted by the index() method.

numbuttons()
Return the number of buttons in the button box.

setdefault(index)
Set the default button to the button given by index. This causes the specified button to be displayed with the platform specific appearance for a default button. If index is None, there will be no default button. index may have any of the forms accepted by the index() method.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack the ButtonBox.
        self.buttonBox = Pmw.ButtonBox(parent,
                labelpos = 'nw',
                label_text = 'ButtonBox:',
                frame_borderwidth = 2,
                frame_relief = 'groove')
        self.buttonBox.pack(fill = 'both', expand = 1, padx = 10, pady = 10)

        # Add some buttons to the ButtonBox.
        self.buttonBox.add('OK', command = self.ok)
        self.buttonBox.add('Apply', command = self.apply)
        self.buttonBox.add('Cancel', command = self.cancel)

        # Set the default button (the one executed when <Return> is hit).
        self.buttonBox.setdefault('OK')
        parent.bind('<Return>', self._processReturnKey)
        parent.focus_set()

        # Make all the buttons the same width.
        self.buttonBox.alignbuttons()

    def _processReturnKey(self, event):
        self.buttonBox.invoke()

    def ok(self):
        print 'You clicked on OK'

    def apply(self):
        print 'You clicked on Apply'

    def cancel(self):
        print 'You clicked on Cancel'

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 24 May 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ComboBox.html0000644000175000017500000003070210656147112017330 0ustar serge2serge2 Pmw.ComboBox reference manual

Pmw.ComboBox

Name

Pmw.ComboBox() - dropdown or simple combination box

Inherits

Pmw.MegaWidget

Description

A combobox contains an entry field and an associated scrolled listbox. When an item in the listbox is selected, it is displayed in the entry field. Optionally, the user may also edit the entry field directly.

For a simple combobox, the scrolled listbox is displayed beneath the entry field. For a dropdown combobox (the default), the scrolled listbox is displayed in a window which pops up beneath the entry field when the user clicks on an arrow button on the right of the entry field. Either style allows an optional label.

Options

Options for this megawidget and its base classes are described below.

autoclear
Initialisation option. If both autoclear and history are true, clear the entry field whenever <Return> is pressed, after adding the value to the history list. The default is 0.

buttonaspect
Initialisation option. The width of the arrow button as a proportion of the height. The height of the arrow button is set to the height of the entry widget. The default is 1.0.

dropdown
Initialisation option. Specifies whether the combobox should be dropdown or simple. The default is 1.

fliparrow
Initialisation option. If true, the arrow button is draw upside down when the listbox is being displayed. Used only in dropdown megawidgets. The default is 0.

history
Initialisation option. When <Return> is pressed in the entry field, the current value of the entry field is appended to the listbox if history is true. The default is 1.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

listheight
Initialisation option. The height, in pixels, of the dropdown listbox. The default is 200.

selectioncommand
The function to call when an item is selected. If this function takes a long time to run, and you want the entry field to be updated quickly, call update_idletasks() at the beginning of the function. Alternatively, wrap the function using Pmw.busycallback(). The default is None.

sticky
Initialisation option. The default is 'ew'.

unique
Initialisation option. If both unique and history are true, the current value of the entry field is not added to the listbox if it is already in the list. The default is 1.

Components

Components created by this megawidget and its base classes are described below.

arrowbutton
In a dropdown combobox, the button to popup the listbox. By default, this component is a Tkinter.Canvas.

entryfield
The entry field where the current selection is displayed. By default, this component is a Pmw.EntryField.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

popup
In a dropdown combobox, the dropdown window. By default, this component is a Tkinter.Toplevel.

scrolledlist
The scrolled listbox which displays the items to select. By default, this component is a Pmw.ScrolledListBox.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

entry
Alias for entryfield_entry.
listbox
Alias for scrolledlist_listbox.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the following classes are forwarded by this megawidget. Methods from Pmw.ScrolledListBox are forwarded to the scrolledlist component. Methods from Pmw.EntryField are forwarded to the entryfield component. Forwarded methods are searched in the order given.

bbox(index)
This method is explicitly forwarded to the scrolledlist component's bbox() method. Without this explicit forwarding, the bbox() method (aliased to grid_bbox()) of the hull would be invoked, which is probably not what the programmer intended.

clear()
Delete all items from the scrolled listbox and delete all text from the entry widget.

get(first = None, last = None)
This is the same as the get() method of the scrolledlist component, except that if first is None then the value of the entry field is returned.

invoke()
If a dropdown combobox, display the dropdown listbox. In a simple combobox, select the currently selected item in the listbox, call the selectioncommand and return the result.

selectitem(index, setentry = 1)
Select the item in the listbox specified by index which may be either one of the items in the listbox or the integer index of one of the items in the listbox.

If setentry is true, also set the entry field to the selected item.

size()
This method is explicitly forwarded to the scrolledlist component's size() method. Without this explicit forwarding, the size() method (aliased to grid_size()) of the hull would be invoked, which is probably not what the programmer intended.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        parent.configure(background = 'white')

        # Create and pack the widget to be configured.
        self.target = Tkinter.Label(parent,
                relief = 'sunken',
                padx = 20,
                pady = 20,
        )
        self.target.pack(fill = 'x', padx = 8, pady = 8)

        # Create and pack the simple ComboBox.
        words = ('Monti', 'Python', 'ik', 'den', 'Holie', 'Grailen', '(Bok)')
        simple = Pmw.ComboBox(parent,
                label_text = 'Simple ComboBox:',
                labelpos = 'nw',
                selectioncommand = self.changeText,
                scrolledlist_items = words,
                dropdown = 0,
        )
        simple.pack(side = 'left', fill = 'both',
                expand = 1, padx = 8, pady = 8)

        # Display the first text.
        first = words[0]
        simple.selectitem(first)
        self.changeText(first)

        # Create and pack the dropdown ComboBox.
        colours = ('cornsilk1', 'snow1', 'seashell1', 'antiquewhite1',
                'bisque1', 'peachpuff1', 'navajowhite1', 'lemonchiffon1',
                'ivory1', 'honeydew1', 'lavenderblush1', 'mistyrose1')
        dropdown = Pmw.ComboBox(parent,
                label_text = 'Dropdown ComboBox:',
                labelpos = 'nw',
                selectioncommand = self.changeColour,
                scrolledlist_items = colours,
        )
        dropdown.pack(side = 'left', anchor = 'n',
                fill = 'x', expand = 1, padx = 8, pady = 8)

        # Display the first colour.
        first = colours[0]
        dropdown.selectitem(first)
        self.changeColour(first)

    def changeColour(self, colour):
        print 'Colour: ' + colour
        self.target.configure(background = colour)

    def changeText(self, text):
        print 'Text: ' + text
        self.target.configure(text = text)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 1 November 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ComboBoxDialog.html0000644000175000017500000002277010656147112020456 0ustar serge2serge2 Pmw.ComboBoxDialog reference manual

Pmw.ComboBoxDialog

Name

Pmw.ComboBoxDialog() - selection dialog displaying a list and an entry field

Inherits

Pmw.Dialog

Description

A combobox dialog is a dialog window which displays a list and an entry field which can be used to prompt the user for a value.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

borderx
Initialisation option. The padding to the left and right of the combobox. The default is 10.

bordery
Initialisation option. The padding above and below the combobox. The default is 10.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('OK',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

combobox
The combobox for the user to enter a value. By default it is created using the option dropdown = 0. By default, this component is a Pmw.ComboBox.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

entry
Alias for combobox_entry.
label
Alias for combobox_label.
listbox
Alias for combobox_listbox.
scrolledlist
Alias for combobox_scrolledlist.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.Dialog. In addition, methods from the Pmw.ComboBox class are forwarded by this megawidget to the combobox component.

bbox(index)
This method is explicitly forwarded to the combobox component's bbox() method. Without this explicit forwarding, the bbox() method (aliased to grid_bbox()) of the hull would be invoked, which is probably not what the programmer intended.

size()
This method is explicitly forwarded to the combobox component's size() method. Without this explicit forwarding, the size() method (aliased to grid_size()) of the hull would be invoked, which is probably not what the programmer intended.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the dialog.
        self.dialog = Pmw.ComboBoxDialog(parent,
            title = 'My ComboBoxDialog',
            buttons = ('OK', 'Cancel'),
            defaultbutton = 'OK',
            combobox_labelpos = 'n',
            label_text = 'What do you think of Pmw?',
            scrolledlist_items = ('Cool man', 'Cool', 'Good', 'Bad', 'Gross'))
        self.dialog.withdraw()

        # Create button to launch the dialog.
        w = Tkinter.Button(parent,
                text = 'Show combo box dialog',
                command = self.doit)
        w.pack(padx = 8, pady = 8)

    def doit(self):
        result = self.dialog.activate()
        print 'You clicked on', result, self.dialog.get()

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/Counter.html0000644000175000017500000004316010656147112017241 0ustar serge2serge2 Pmw.Counter reference manual

Pmw.Counter

Name

Pmw.Counter() - entry field with up and down arrow buttons

Inherits

Pmw.MegaWidget

Description

A counter contains an entry field and two arrow buttons to increment and decrement the value in the entry field. Standard counting types include numbers, times and dates. A user defined counting function may also be supplied for specialised counting. Counting can be used in combination with the entry field's validation. The components may be laid out horizontally or vertically.

Each time an arrow button is pressed the value displayed in the entry field is incremented or decremented by the value of the increment option. If the new value is invalid (according to the entry field's validate option, perhaps due to exceeding minimum or maximum limits), the old value is restored.

When an arrow button is pressed and the value displayed is not an exact multiple of the increment, it is "truncated" up or down to the nearest increment.

Options

Options for this megawidget and its base classes are described below.

autorepeat
If true, the counter will continue to count up or down while an arrow button is held pressed down. The default is 1.

buttonaspect
Initialisation option. Specifies the width of the arrow buttons as a proportion of their height. Values less than 1.0 will produce thin arrow buttons. Values greater than 1.0 will produce fat arrow buttons. The default is 1.0.

datatype
Specifies how the counter should count up and down.

The most general way to specify the datatype option is as a dictionary. The kind of counting is specified by the 'counter' dictionary field, which may be either a function or the name of one of the standard counters described below. If the dictionary does not have a 'counter' field, the field defaults to 'numeric'.

Any other fields in the dictionary are passed on to the counter function as keyword arguments.

If datatype is not a dictionary, then it is equivalent to specifying it as a dictionary with a single 'counter' field. For example, datatype = 'real' is equivalent to datatype = {'counter' : 'real'}.

The standard counters are:

'numeric'
An integer number, as accepted by string.atol().

'integer'
Same as 'numeric'.

'real'
A real number, as accepted by string.atof(). This counter accepts a 'separator' argument, which specifies the character used to represent the decimal point. The default 'separator' is '.'.

'time'
A time specification, as accepted by Pmw.timestringtoseconds(). This counter accepts a 'separator' argument, which specifies the character used to separate the time fields. The default separator is ':'. This counter also accepts a 'time24' argument. If this is true, the time value is converted to a value between '00:00:00' and '23:59:59'. The default is false.

'date'
A date specification, as accepted by Pmw.datestringtojdn(). This counter accepts a 'separator' argument, which specifies the character used to separate the three date fields. The default is '/'. This counter also accepts a 'format' argument, which is passed to Pmw.datestringtojdn() to specify the desired ordering of the fields. The default is 'ymd'. This counter also accepts a 'yyyy' argument. If this is false, the year field will be displayed as the year within the century, otherwise it will be fully displayed. In both cases it will be displayed with at least 2 digits, using leading zeroes. The default is false.

If the 'counter' dictionary field is a function, then it will be called whenever the counter is to be incremented or decremented. The function is called with at least three arguments, the first three being (text, factor, increment), where text is the current contents of the entry field, factor is 1 when incrementing or -1 when decrementing, and increment is the value of the increment megawidget option.

The other arguments are keyword arguments made up of the fields of the datatype dictionary (excluding the 'counter' field).

The counter function should return a string representing the incremented or decremented value. It should raise a ValueError exception if the text is invalid. In this case the bell is rung and the entry text is not changed.

The default for datatype is numeric.

increment
Specifies how many units should be added or subtracted when the counter is incremented or decremented. If the currently displayed value is not a multiple of increment, the value is changed to the next multiple greater or less than the current value.

For the number datatypes, the value of increment is a number. For the 'time' datatype, the value is in seconds. For the 'date' datatype, the value is in days. The default is 1.

initwait
Specifies the initial delay (in milliseconds) before a depressed arrow button automatically starts to repeat counting. The default is 300.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

orient
Initialisation option. Specifies whether the arrow buttons should appear to the left and right of the entry field ('horizontal') or above and below ('vertical'). The default is 'horizontal'.

padx
Initialisation option. Specifies a padding distance to leave around the arrow buttons in the x direction. The default is 0.

pady
Initialisation option. Specifies a padding distance to leave around the arrow buttons in the y direction. The default is 0.

repeatrate
Specifies the delay (in milliseconds) between automatic counts while an arrow button is held pressed down. The default is 50.

sticky
Initialisation option. The default is 'ew'.

Components

Components created by this megawidget and its base classes are described below.

downarrow
The arrow button used for decrementing the counter. Depending on the value of orient, it will appear on the left or below the entry field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

entryfield
The entry field widget where the text is entered, displayed and validated. By default, this component is a Pmw.EntryField.

frame
If the label component has been created (that is, the labelpos option is not None), the frame component is created to act as the container of the entry field and arrow buttons. If there is no label component, then no frame component is created and the hull component acts as the container. In either case the border around the container of the entry field and arrow buttons will be raised (but not around the label). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

uparrow
The arrow button used for incrementing the counter. Depending on the value of orient, it will appear on the right or above the entry field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

entry
Alias for entryfield_entry.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the Pmw.EntryField class are forwarded by this megawidget to the entryfield component.

decrement()
Decrement the counter once, as if the down arrow had been pressed.

increment()
Increment the counter once, as if the up arrow had been pressed.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Need to use long ints here because on the Macintosh the maximum size
        # of an integer is smaller than the value returned by time.time().
        now = (long(time.time()) / 300) * 300

        # Create the Counters.
        self._date = Pmw.Counter(parent,
                labelpos = 'w',
                label_text = 'Date (4-digit year):',
                entryfield_value =
                        time.strftime('%d/%m/%Y', time.localtime(now)),
                entryfield_command = self.execute,
                entryfield_validate = {'validator' : 'date', 'format' : 'dmy'},
                datatype = {'counter' : 'date', 'format' : 'dmy', 'yyyy' : 1})

        self._isodate = Pmw.Counter(parent,
                labelpos = 'w',
                label_text = 'ISO-Date (4-digit year):',
                entryfield_value =
                        time.strftime('%Y-%m-%d', time.localtime(now)),
                entryfield_command = self.execute,
                entryfield_validate = {'validator' : 'date', 'format' : 'ymd',
                        'separator' : '-' },
                datatype = {'counter' : 'date', 'format' : 'ymd', 'yyyy' : 1,
                        'separator' : '-' })

        self._time = Pmw.Counter(parent,
                labelpos = 'w',
                label_text = 'Time:',
                entryfield_value =
                        time.strftime('%H:%M:%S', time.localtime(now)),
                entryfield_validate = {'validator' : 'time',
                        'min' : '00:00:00', 'max' : '23:59:59',
                        'minstrict' : 0, 'maxstrict' : 0},
                datatype = {'counter' : 'time', 'time24' : 1},
                increment=5*60)
        self._real = Pmw.Counter(parent,
                labelpos = 'w',
                label_text = 'Real (with comma)\nand extra\nlabel lines:',
                label_justify = 'left',
                entryfield_value = '1,5',
                datatype = {'counter' : 'real', 'separator' : ','},
                entryfield_validate = {'validator' : 'real',
                        'min' : '-2,0', 'max' : '5,0',
                        'separator' : ','},
                increment = 0.1)
        self._custom = Pmw.Counter(parent,
                labelpos = 'w',
                label_text = 'Custom:',
                entryfield_value = specialword[:4],
                datatype = _custom_counter,
                entryfield_validate = _custom_validate)
        self._int = Pmw.Counter(parent,
                labelpos = 'w',
                label_text = 'Vertical integer:',
                orient = 'vertical',
                entry_width = 2,
                entryfield_value = 50,
                entryfield_validate = {'validator' : 'integer',
                        'min' : 0, 'max' : 99}
        )

        counters = (self._date, self._isodate, self._time, self._real,
                self._custom)
        Pmw.alignlabels(counters)

        # Pack them all.
        for counter in counters:
            counter.pack(fill='both', expand=1, padx=10, pady=5)
        self._int.pack(padx=10, pady=5)

    def execute(self):
        print 'Return pressed, value is', self._date.get()

specialword = 'Monti Python ik den Holie Grailen (Bok)'

def _custom_validate(text):
    if string.find(specialword, text) == 0:
        return 1
    else:
        return -1

def _custom_counter(text, factor, increment):
    # increment is ignored here.
    if string.find(specialword, text) == 0:
        length = len(text)
        if factor == 1:
            if length >= len(specialword):
                raise ValueError, 'maximum length reached'
            return specialword[:length + 1]
        else:
            if length == 0:
                raise ValueError, 'empty string'
            return specialword[:length - 1]
    else:
        raise ValueError, 'bad string ' + text

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 24 May 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/CounterDialog.html0000644000175000017500000002346110656147112020363 0ustar serge2serge2 Pmw.CounterDialog reference manual

Pmw.CounterDialog

Name

Pmw.CounterDialog() - selection dialog displaying a counter

Inherits

Pmw.Dialog

Description

A counter dialog is a dialog window which displays a counter which can be used to prompt the user for a value.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

borderx
Initialisation option. The padding to the left and right of the counter. The default is 20.

bordery
Initialisation option. The padding above and below the counter. The default is 20.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('OK',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

counter
The counter for the user to enter a value. By default, this component is a Pmw.Counter.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

entry
Alias for counter_entryfield_entry.
entryfield
Alias for counter_entryfield.
label
Alias for counter_label.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.Dialog. In addition, methods from the Pmw.Counter class are forwarded by this megawidget to the counter component.

deleteentry(first, last = None)
Delete text from the counter's entry widget. An alias for component('entry').delete().

indexentry(index)
An alias for component('entry').index().

insertentry(index, text)
Insert text into the counter's entry widget. An alias for component('entry').insert().

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the dialog to prompt for the number of times to ring the bell.
        self.dialog = Pmw.CounterDialog(parent,
            label_text = 'Enter the number of times to\n' + \
                    'sound the bell (1 to 5)\n',
            counter_labelpos = 'n',
            entryfield_value = 2,
            counter_datatype = 'numeric',
            entryfield_validate =
                {'validator' : 'numeric', 'min' : 1, 'max' : 5},
            buttons = ('OK', 'Cancel'),
            defaultbutton = 'OK',
            title = 'Bell ringing',
            command = self.execute)
        self.dialog.withdraw()

        # Create button to launch the dialog.
        w = Tkinter.Button(parent, text = 'Show counter dialog',
                command = self.dialog.activate)
        w.pack(padx = 8, pady = 8)

    def execute(self, result):
        if result is None or result == 'Cancel':
            print 'Bell ringing cancelled'
            self.dialog.deactivate()
        else:
            count = self.dialog.get()
            if not self.dialog.valid():
                print 'Invalid entry: "' + count + '"'
            else:
                print 'Ringing the bell ' + count + ' times'
                for num in range(string.atoi(count)):
                    if num != 0:
                        self.dialog.after(200)
                    self.dialog.bell()
                self.dialog.deactivate()

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/Dialog.html0000644000175000017500000002324010656147112017016 0ustar serge2serge2 Pmw.Dialog reference manual

Pmw.Dialog

Name

Pmw.Dialog() - toplevel window with button box

Inherits

Pmw.MegaToplevel

Description

A dialog is a toplevel window composed of a button box and a child site area. The child site area can be used to specialise the megawidget by creating other widgets within it. This can be done by using this class directly or by deriving from it.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('OK',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaToplevel.

interior()
Return the child site for the dialog. This is the same as component('dialogchildsite').

invoke(index = Pmw.DEFAULT)
Invoke the command specified by the command option as if the button specified by index had been pressed and return the result. index may have any of the forms accepted by the Pmw.ButtonBox index() method.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create two buttons to launch the dialog.
        w = Tkinter.Button(parent, text = 'Show application modal dialog',
                command = self.showAppModal)
        w.pack(padx = 8, pady = 8)

        w = Tkinter.Button(parent, text = 'Show global modal dialog',
                command = self.showGlobalModal)
        w.pack(padx = 8, pady = 8)

        w = Tkinter.Button(parent, text = 'Show dialog with "no grab"',
                command = self.showDialogNoGrab)
        w.pack(padx = 8, pady = 8)

        w = Tkinter.Button(parent, text =
                    'Show toplevel window which\n' +
                    'will not get a busy cursor',
                command = self.showExcludedWindow)
        w.pack(padx = 8, pady = 8)

        # Create the dialog.
        self.dialog = Pmw.Dialog(parent,
            buttons = ('OK', 'Apply', 'Cancel', 'Help'),
            defaultbutton = 'OK',
            title = 'My dialog',
            command = self.execute)
        self.dialog.withdraw()

        # Add some contents to the dialog.
        w = Tkinter.Label(self.dialog.interior(),
            text = 'Pmw Dialog\n(put your widgets here)',
            background = 'black',
            foreground = 'white',
            pady = 20)
        w.pack(expand = 1, fill = 'both', padx = 4, pady = 4)

        # Create the window excluded from showbusycursor.
        self.excluded = Pmw.MessageDialog(parent,
            title = 'I still work',
            message_text =
                'This window will not get\n' +
                'a busy cursor when modal dialogs\n' +
                'are activated.  In addition,\n' +
                'you can still interact with\n' +
                'this window when a "no grab"\n' +
                'modal dialog is displayed.')
        self.excluded.withdraw()
        Pmw.setbusycursorattributes(self.excluded.component('hull'),
            exclude = 1)

    def showAppModal(self):
        self.dialog.activate(geometry = 'centerscreenalways')

    def showGlobalModal(self):
        self.dialog.activate(globalMode = 1)

    def showDialogNoGrab(self):
        self.dialog.activate(globalMode = 'nograb')

    def showExcludedWindow(self):
        self.excluded.show()

    def execute(self, result):
        print 'You clicked on', result
        if result not in ('Apply', 'Help'):
            self.dialog.deactivate(result)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/EntryField.html0000644000175000017500000005420110656147112017665 0ustar serge2serge2 Pmw.EntryField reference manual

Pmw.EntryField

Name

Pmw.EntryField() - entry widget with validation

Inherits

Pmw.MegaWidget

Description

An entry field contains an entry widget with optional validation of various kinds. Built-in validation may be used, such as integer, real, time or date, or an external validation function may be supplied. If valid text is entered, it will be displayed with the normal background. If invalid text is entered, it is not displayed and the previously displayed text is restored. If partially valid text is entered, it will be displayed with a background color to indicate it is in error. An example of partially valid real text is '-.', which may be the first two charactes of the valid string '-.5'. Some validators, such as date, have a relaxed interpretation of partial validity, which allows the user flexibility in how they enter the text.

Validation is performed early, at each keystroke or other event which modifies the text. However, if partially valid text is permitted, the validity of the entered text can be checked just before it is to be used, which is a form of late validation.

Minimum and maximum values may be specified. Some validators also accept other specifications, such as date and time formats and separators.

Validation function return values

Validation is performed by a function which takes as its first argument the entered text and returns one of three standard values, indicating whether the text is valid:

Pmw.OK
The text is valid.

Pmw.ERROR
The text is invalid and is not acceptable for display. In this case the entry will be restored to its previous value.

Pmw.PARTIAL
The text is partially valid and is acceptable for display. In this case the text will be displayed using the errorbackground color.

Options

Options for this megawidget and its base classes are described below.

command
This specifies a function to call whenever the <Return> key is pressed or invoke() is called. The default is None.

errorbackground
Specifies the background color to use when displaying invalid or partially valid text. The default is 'pink'.

extravalidators
This is a dictionary of extra validators. The keys are the names of validators which may be used in a future call to the validate option. Each value in the dictionary is a tuple of (validate_function, stringtovalue_function).

The validate_function is used to implement the validation and the stringtovalue_function is used to convert the entry input into a value which can be compared with the minimum and maximum limits. These functions are as described for the validate option.

If either of these is not given as a function, it is assumed to be the name of one of the other extra validators or one of the standard validators. The alias search is performed when the validate option is configured, not when the extravalidators option is configured or when the validate function is called.

If the name of one of the extra validators is the same as one of the standard validators, the extra validator takes precedence. The default is {}.

invalidcommand
This is executed when invalid text is entered and the text is restored to its previous value (that is, when the validate function returns Pmw.ERROR). It is also called if an attempt is made to set invalid text in a call to setentry(). The default is self.bell.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

modifiedcommand
This is called whenever the text of the entry has been changed due to user action or by a call to setentry(). The default is None.

sticky
Initialisation option. The default is 'ew'.

validate
Specifies what kind of validation should be performed on the entry input text.

The most general way to specify the validate option is as a dictionary. The kind of validation is specified by the 'validator' dictionary field, which may be the name of one of the standard validators described below, the name of a validator supplied by the extravalidators option, a function or None. The default is None.

Any other dictionary fields specify other restrictions on the entered values. For all validators, the following fields may be specified:

'min'
Specifies the minimum acceptable value, or None if no minimum checking should be performed. The default is None.

'max'
Specifies the maximum acceptable value, or None if no maximum checking should be performed. The default is None.

'minstrict'
If true, then minimum checking is strictly enforced. Otherwise, the entry input may be less than min, but will be displayed using the errorbackground color. The default is true.

'maxstrict'
If true, then maximum checking is strictly enforced. Otherwise, the entry input may be more than max, but will be displayed using the errorbackground color. The default is true.

If the dictionary contains a 'stringtovalue' field, it overrides the normal stringtovalue function for the validator. The stringtovalue function is described below.

Other fields in the dictionary (apart from the core fields mentioned above) are passed on to the validator and stringtovalue functions as keyword arguments.

If validate is not a dictionary, then it is equivalent to specifying it as a dictionary with a single 'validator' field. For example, validate = 'real' is equivalent to /validate = {'validator' : 'real'}/ and specifies real numbers without any minimum or maximum limits and using '.' as the decimal point character.

The standard validators accepted in the 'validator' field are:

'numeric'
An integer greater than or equal to 0. Digits only. No sign.

'integer'
Any integer (negative, 0 or positive) as accepted by string.atol().

'hexadecimal'
Hex number (with optional leading '0x'), as accepted by string.atol(text, 16).

'real'
A number, with or without a decimal point and optional exponent (e or E), as accepted by string.atof(). This validator accepts a 'separator' argument, which specifies the character used to represent the decimal point. The default 'separator' is '.'.

'alphabetic'
Consisting of the letters 'a-z' and 'A-Z'. In this case, 'min' and 'max' specify limits on the length of the text.

'alphanumeric'
Consisting of the letters 'a-z', 'A-Z' and '0-9'. In this case, 'min' and 'max' specify limits on the length of the text.

'time'
Hours, minutes and seconds, in the format 'HH:MM:SS', as accepted by Pmw.timestringtoseconds(). This validator accepts a 'separator' argument, which specifies the character used to separate the three fields. The default separator is ':'. The time may be negative.

'date'
Day, month and year, as accepted by Pmw.datestringtojdn(). This validator accepts a 'separator' argument, which specifies the character used to separate the three fields. The default is ':'. This validator also accepts a 'format' argument, which is passed to Pmw.datestringtojdn() to specify the desired ordering of the fields. The default is 'ymd'.

If 'validator' is a function, then it will be called whenever the contents of the entry may have changed due to user action or by a call to setentry(). The function is called with at least one argument, the first one being the new text as modified by the user or setentry(). The other arguments are keyword arguments made up of the non-core fields of the validate dictionary.

The validator function should return Pmw.OK, Pmw.ERROR or Pmw.PARTIAL as described above. It should not perform minimum and maximum checking. This is done after the call, if it returns Pmw.OK.

The 'stringtovalue' field in the dictionary may be specified as the name of one of the standard validators, the name of a validator supplied by the extravalidators option, a function or None.

The stringtovalue function is used to convert the entry input into a value which can then be compared with any minimum or maximum values specified for the validator. If the 'min' or 'max' fields are specified as strings, they are converted using the stringtovalue function. The stringtovalue function is called with the same arguments as the validator function. The stringtovalue function for the standard number validators convert the string to a number. Those for the standard alpha validators return the length of the string. Those for the standard 'time' and 'date' validators return the number of seconds and the Julian Day Number, respectively. See Pmw.stringtoreal(), Pmw.timestringtoseconds() and Pmw.datestringtojdn().

If the validator has been specified as a function and no 'stringtovalue' field is given, then it defaults to the standard python len() function.

If 'validator' is None, no validation is performed. However, minimum and maximum checking may be performed, according to the stringtovalue function. For example, to limit the entry text to a maximum of five characters:

 Pmw.EntryField(validate = {'max' : 5})

The validator functions for each of the standard validators can be accessed as:

 Pmw.numericvalidator
 Pmw.integervalidator
 Pmw.hexadecimalvalidator
 Pmw.realvalidator
 Pmw.alphabeticvalidator
 Pmw.alphanumericvalidator
 Pmw.timevalidator
 Pmw.datevalidator

Whenever the validate option is configured, the text currently displayed in the entry widget is revalidated. If it is not valid, the errorbackground color is set and the invalidcommand function is called. However, the displayed text is not modified.

The default for validate is None.

value
Initialisation option. Specifies the initial contents of the entry. If this text is invalid, it will be displayed with the errorbackground color and the invalidcommand function will be called. If both value and entry_textvariable options are specified in the constructor, value will take precedence. The default is ''.

Components

Components created by this megawidget and its base classes are described below.

entry
The widget where the user may enter text. Long text may be scrolled horizontally by dragging with the middle mouse button. By default, this component is a Tkinter.Entry.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the Tkinter.Entry class are forwarded by this megawidget to the entry component.

checkentry()
Check the validity of the current contents of the entry widget and return the result. If the text is not valid, set the background to errorbackground and call the invalidcommand function. If there is a variable specified by the entry_textvariable option, this method should be called after the set() method of the variable is called. If this is not done in this case, the entry widget background will not be set correctly.

clear()
Remove all text from the entry widget. Equivalent to setentry('').

getvalue()
Return the text displayed by the entry.

invoke()
Invoke the command specified by the command option as if the <Return> key had been pressed and return the result.

setentry(text)
Same as setvalue() method.

setvalue(text)
Set the contents of the entry widget to text and carry out validation as if the text had been entered by the user. If the text is invalid, the entry widget will not be changed and the invalidcommand function will be called. Return the validity of text.

valid()
Return true if the contents of the entry widget are valid.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack the EntryFields.
        self._any = Pmw.EntryField(parent,
                labelpos = 'w',
                label_text = 'Any:',
                validate = None,
                command = self.execute)
        self._real = Pmw.EntryField(parent,
                labelpos = 'w',
                value = '55.5',
                label_text = 'Real (10.0 to 99.0):',
                validate = {'validator' : 'real',
                        'min' : 10, 'max' : 99, 'minstrict' : 0},
                modifiedcommand = self.changed)
        self._odd = Pmw.EntryField(parent,
                labelpos = 'w',
                label_text = 'Odd length:',
                validate = self.custom_validate,
                value = 'ABC')
        self._date = Pmw.EntryField(parent,
                labelpos = 'w',
                label_text = 'Date (in 2000):',
                value = '2000/2/29',
                validate = {'validator' : 'date',
                        'min' : '2000/1/1', 'max' : '2000/12/31',
                        'minstrict' : 0, 'maxstrict' : 0,
                        'format' : 'ymd'},
                )
        now = time.localtime(time.time())
        self._date2 = Pmw.EntryField(parent,
                labelpos = 'w',
                label_text = 'Date (d.m.y):',
                value = '%d.%d.%d' % (now[2], now[1], now[0]),
                validate = {'validator' : 'date',
                        'format' : 'dmy', 'separator' : '.'},
                )
        self._time = Pmw.EntryField(parent,
                labelpos = 'w',
                label_text = 'Time (24hr clock):',
                value = '8:00:00',
                validate = {'validator' : 'time',
                        'min' : '00:00:00', 'max' : '23:59:59',
                        'minstrict' : 0, 'maxstrict' : 0},
                )
        self._comma = Pmw.EntryField(parent,
                labelpos = 'w',
                label_text = 'Real (with comma):',
                value = '123,456',
                validate = {'validator' : 'real', 'separator' : ','},
                )

        entries = (self._any, self._real, self._odd, self._date, self._date2,
                self._time, self._comma)

        for entry in entries:
            entry.pack(fill='x', expand=1, padx=10, pady=5)
        Pmw.alignlabels(entries)

        self._any.component('entry').focus_set()

    def changed(self):
        print 'Text changed, value is', self._real.getvalue()

    def execute(self):
        print 'Return pressed, value is', self._any.getvalue()

    # This implements a custom validation routine.  It simply checks
    # if the string is of odd length.
    def custom_validate(self, text):
        print 'text:', text
        if len(text) % 2 == 0:
          return -1
        else:
          return 1

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 22 May 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/Group.html0000644000175000017500000001624010656147112016715 0ustar serge2serge2 Pmw.Group reference manual

Pmw.Group

Name

Pmw.Group() - frame with ring border and tag

Inherits

Pmw.MegaWidget

Description

This megawidget consists of an interior frame with an exterior ring border and an identifying tag displayed over the top edge of the ring. The programmer can create other widgets within the interior frame.

Options

Options for this megawidget and its base classes are described below.

collapsedsize
Initialisation option. The distance from the bottom of the tag to the bottom of the ring when the groupchildsite is collapsed. The default is 6.

tagindent
Initialisation option. The distance from the left edge of the ring to the left side of the tag component. The default is 10.

Components

Components created by this megawidget and its base classes are described below.

groupchildsite
The frame which can contain other widgets to be grouped. By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

ring
This component acts as the enclosing ring around the groupchildsite. The default borderwidth is 2 and the default relief is 'groove'. By default, this component is a Tkinter.Frame.

tag
The identifying tag displayed over the top edge of the enclosing ring. If the pyclass for this component is None, (ie: tag_pyclass = None, then no tag component is created. By default, this component is a Tkinter.Label.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

collapse()
Do not display the groupchildsite component.

expand()
Display the groupchildsite component.

interior()
Return the frame within which the programmer may create widgets. This is the same as component('groupchildsite').

toggle()
Display the groupchildsite component if it is currently hidden and hide it if it is currently displayed.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):

        # Create and pack the Groups.
        w = Pmw.Group(parent, tag_text='label')
        w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
        cw = Tkinter.Label(w.interior(),
                text = 'A group with the\ndefault Label tag')
        cw.pack(padx = 2, pady = 2, expand='yes', fill='both')

        w = Pmw.Group(parent, tag_pyclass = None)
        w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
        cw = Tkinter.Label(w.interior(), text = 'A group\nwithout a tag')
        cw.pack(padx = 2, pady = 2, expand='yes', fill='both')

        radiogroups = []
        self.var = Tkinter.IntVar()
        self.var.set(0)
        radioframe = Tkinter.Frame(parent)
        w = Pmw.Group(radioframe,
                tag_pyclass = Tkinter.Radiobutton,
                tag_text='radiobutton 1',
                tag_value = 0,
                tag_variable = self.var)
        w.pack(fill = 'both', expand = 1, side='left')
        cw = Tkinter.Frame(w.interior(),width=200,height=20)
        cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
        radiogroups.append(w)

        w = Pmw.Group(radioframe,
                tag_pyclass = Tkinter.Radiobutton,
                tag_text='radiobutton 2',
                tag_font = Pmw.logicalfont('Helvetica', 4),
                tag_value = 1,
                tag_variable = self.var)
        w.pack(fill = 'both', expand = 1, side='left')
        cw = Tkinter.Frame(w.interior(),width=200,height=20)
        cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
        radiogroups.append(w)
        radioframe.pack(padx = 6, pady = 6, expand='yes', fill='both')
        Pmw.aligngrouptags(radiogroups)

        w = Pmw.Group(parent,
                tag_pyclass = Tkinter.Checkbutton,
                tag_text='checkbutton',
                tag_foreground='blue')
        w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
        cw = Tkinter.Frame(w.interior(),width=150,height=20)
        cw.pack(padx = 2, pady = 2, expand='yes', fill='both')

        w = Pmw.Group(parent,
                tag_pyclass = Tkinter.Button,
                tag_text='Tkinter.Button')
        w.configure(tag_command = w.toggle)
        w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
        cw = Tkinter.Label(w.interior(),
                background = 'aliceblue',
                text = 'A group with\na Button tag!?'
        )
        cw.pack(padx = 2, pady = 2, expand='yes', fill='both')

        w = Pmw.Group(parent,
                tag_pyclass = Tkinter.Button,
                tag_text='Show/Hide')
        w.configure(tag_command = w.toggle)
        w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
        cw = Tkinter.Label(w.interior(),
                background = 'aliceblue',
                text = 'Now you see me.\nNow you don\'t.'
        )
        cw.pack(padx = 2, pady = 2, expand='yes', fill='both')

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 15 November 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/HistoryText.html0000644000175000017500000003651510656147112020136 0ustar serge2serge2 Pmw.HistoryText reference manual

Pmw.HistoryText

Name

Pmw.HistoryText() - text widget with a course-grained form of history

Inherits

Pmw.ScrolledText

Description

A history text is a scrolled text widget with added functionality to maintain a history of each screen and allow editing of prior screens. Here, screen refers to the entire contents of the text widget. This widget does not support a fine-grained history of every change made to the text.

Together with a few buttons and a scrolled text to display the results, a history text can be used as the query-entry part of a simple interactive text-based database query system. When the user enters and executes a query, the query (the entire contents of the text widget) is added to the history list. The user may view previous queries and either execute them again or modify them and execute the new query. If a previously executed query is modified, the user may undo or redo all changes made to the query before the query is executed.

Options

Options for this megawidget and its base classes are described below.

borderframe
Initialisation option. If true, the borderframe component will be created. The default is 0.

columnheader
Initialisation option. If true, the columnheader component will be created. The default is 0.

compressany
See addhistory(). The default is 1.

compresstail
See addhistory(). The default is 1.

historycommand
This is a callback to indicate whether the currently displayed entry in the history list has a previous or next entry. The callback is given two arguments, prevstate and nextstate. If the currently displayed entry is first in the history list, then prevstate is 'disabled', otherwise it is 'normal'. If the currently displayed entry is last in the history list, then nextstate is 'disabled', otherwise it is 'normal'. These values can be used, for example, to modify the state of Next and Previous buttons that call the next() and prev() methods. The default is None.

hscrollmode
The horizontal scroll mode. If 'none', the horizontal scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

rowcolumnheader
Initialisation option. If true, the rowcolumnheader component will be created. The default is 0.

rowheader
Initialisation option. If true, the rowheader component will be created. The default is 0.

scrollmargin
Initialisation option. The distance between the scrollbars and the text widget. The default is 2.

usehullsize
Initialisation option. If true, the size of the megawidget is determined solely by the width and height options of the hull component.

Otherwise, the size of the megawidget is determined by the width and height of the text component, along with the size and/or existence of the other components, such as the label, the scrollbars and the scrollmargin option. All these affect the overall size of the megawidget. The default is 0.

vscrollmode
The vertical scroll mode. If 'none', the vertical scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

Components

Components created by this megawidget and its base classes are described below.

borderframe
A frame widget which snuggly fits around the text widget, to give the appearance of a text border. It is created with a border so that the text widget, which is created without a border, looks like it has a border. By default, this component is a Tkinter.Frame.

columnheader
A text widget with a default height of 1 displayed above the main text widget and which scrolls horizontally in sync with the horizontal scrolling of the main text widget. By default, this component is a Tkinter.Text. Its component group is Header.

horizscrollbar
The horizontal scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

rowcolumnheader
A text widget displayed to the top left of the main text widget, above the row header and to the left of the column header if they exist. The widget is not scrolled automatically. By default, this component is a Tkinter.Text. Its component group is Header.

rowheader
A text widget displayed to the left of the main text widget and which scrolls vertically in sync with the vertical scrolling of the main text widget. By default, this component is a Tkinter.Text. Its component group is Header.

text
The text widget which is scrolled by the scrollbars. If the borderframe option is true, this is created with a borderwidth of 0 to overcome a known problem with text widgets: if a widget inside a text widget extends across one of the edges of the text widget, then the widget obscures the border of the text widget. Therefore, if the text widget has no border, then this overlapping does not occur. By default, this component is a Tkinter.Text.

vertscrollbar
The vertical scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.ScrolledText.

addhistory()
Append the currently displayed text to the history list.

If compressany is true, a new entry will be added to the history list only if the currently displayed entry has changed.

If compresstail is true, a new entry will be added to the history list only if the currently displayed entry has changed or if it is not the last entry in the history list.

gethistory()
Return the history list. Each entry in the list is a 3-tuple. The first item in a history entry is the original text as added by addhistory(). The second item is the edited text (if the user has modified the entry but addhistory() has not yet been called on the text). The third item specifies whether the entry should currently display the original or modified text.

next()
Display the next screen in the history list.

prev()
Display the previous screen in the history list.

redo()
Reverse the effect of undo().

undo()
Undo all changes made since this entry was added to the history list.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack the PanedWidget to hold the query and result
        # windows.
        # !! panedwidget should automatically size to requested size
        panedWidget = Pmw.PanedWidget(parent,
                orient = 'vertical',
                hull_height = 400,
                hull_width = 550)
        panedWidget.add('query', min = 0.05, size = 0.2)
        panedWidget.add('buttons', min = 0.1, max = 0.1)
        panedWidget.add('results', min = 0.05)
        panedWidget.pack(fill = 'both', expand = 1)

        # Create and pack the HistoryText.
        self.historyText = Pmw.HistoryText(panedWidget.pane('query'),
                text_wrap = 'none',
                text_width = 60,
                text_height = 10,
                historycommand = self.statechange,
        )
        self.historyText.pack(fill = 'both', expand = 1)
        self.historyText.component('text').focus()

        buttonList = (
            [20, None],
            ['Clear', self.clear],
            ['Undo', self.historyText.undo],
            ['Redo', self.historyText.redo],
            [20, None],
            ['Prev', self.historyText.prev],
            ['Next', self.historyText.next],
            [30, None],
            ['Execute', Pmw.busycallback(self.executeQuery)],
        )
        self.buttonDict = {}

        buttonFrame = panedWidget.pane('buttons')
        for text, cmd in buttonList:
            if type(text) == type(69):
                frame = Tkinter.Frame(buttonFrame, width = text)
                frame.pack(side = 'left')
            else:
                button = Tkinter.Button(buttonFrame, text = text, command = cmd)
                button.pack(side = 'left')
                self.buttonDict[text] = button

        for text in ('Prev', 'Next'):
            self.buttonDict[text].configure(state = 'disabled')

        self.results = Pmw.ScrolledText(panedWidget.pane('results'), text_wrap = 'none')
        self.results.pack(fill = 'both', expand = 1)

    def statechange(self, prevstate, nextstate):
        self.buttonDict['Prev'].configure(state = prevstate)
        self.buttonDict['Next'].configure(state = nextstate)

    def clear(self):
        self.historyText.delete('1.0', 'end')

    def addnewlines(self, text):
        if len(text) == 1:
            text = text + '\n'
        if text[-1] != '\n':
            text = text + '\n'
        if text[-2] != '\n':
            text = text + '\n'
        return text

    def executeQuery(self):
        sql = self.historyText.get()
        self.results.insert('end', 'Query:\n' + self.addnewlines(sql))
        self.results.see('end')
        self.results.update_idletasks()
        self.historyText.addhistory()
        results = 'Results:\nfoo'
        if len(results) > 0:
            self.results.insert('end', self.addnewlines(results))
        self.results.see('end')

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 20 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/LabeledWidget.html0000644000175000017500000001274510656147112020323 0ustar serge2serge2 Pmw.LabeledWidget reference manual

Pmw.LabeledWidget

Name

Pmw.LabeledWidget() - frame with label

Inherits

Pmw.MegaWidget

Description

This megawidget consists of an interior frame with an associated label which can be positioned on any side of the frame. The programmer can create other widgets within the interior frame.

Options

Options for this megawidget and its base classes are described below.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

sticky
Initialisation option. The default is 'nsew'.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

labelchildsite
The frame which can contain other widgets to be labelled. By default, this component is a Tkinter.Frame.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

interior()
Return the frame within which the programmer may create widgets. This is the same as component('labelchildsite').

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):

        # Create a frame to put the LabeledWidgets into
        frame = Tkinter.Frame(parent, background = 'grey90')
        frame.pack(fill = 'both', expand = 1)

        # Create and pack the LabeledWidgets.
        column = 0
        row = 0
        for pos in ('n', 'nw', 'wn', 'w'):
            lw = Pmw.LabeledWidget(frame,
                    labelpos = pos,
                    label_text = pos + ' label')
            lw.component('hull').configure(relief='sunken', borderwidth=2)
            lw.grid(column=column, row=row, padx=10, pady=10)
            cw = Tkinter.Button(lw.interior(), text='child\nsite')
            cw.pack(padx=10, pady=10, expand='yes', fill='both')

            # Get ready for next grid position.
            column = column + 1
            if column == 2:
              column = 0
              row = row + 1

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 8 November 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MainMenuBar.html0000644000175000017500000004131710656147112017762 0ustar serge2serge2 Pmw.MainMenuBar reference manual

Pmw.MainMenuBar

Name

Pmw.MainMenuBar() - manager for toplevel native menus

Inherits

Pmw.MegaArchetype

Description

This class is a wrapper for the Tkinter.Menu class. It should be used as the main menu of toplevel windows. The class is similar to Pmw.MenuBar, but should be used when native menus are required. See the Tkinter.Menu documentation for full details.

This class should be created as the child of a Tkinter.Toplevel and should then be specified as the menu associated with the toplevel, using the toplevel's configure() method. For example:

 # Create a Pmw.MegaToplevel.
 megaToplevel = Pmw.MegaToplevel()
 # Get the Tkinter.Toplevel from Pmw.MegaToplevel.
 toplevel = megaToplevel.interior()
 # Create the menu bar for the toplevel.
 menuBar = Pmw.MainMenuBar(toplevel)
 # Configure the toplevel to use the menuBar.
 toplevel.configure(menu = menuBar)

There are methods to add menus, both as toplevel menus and sub-menus, and for adding menu items to the menus. Each menu item may have help text to be displayed by a Pmw.Balloon. Each menu and cascaded menu (sub-menu) is referenced by name which is supplied on creation.

This megawidget is derived from Pmw.MegaArchetype (not Pmw.MegaWidget like most other megawidgets), with the hull class being Tkinter.Menu.

(Note that due to bugs in Tk's menubar functionality, balloon help has not been implemented and status help does not work properly.)

Options

Options for this megawidget and its base classes are described below.

balloon
Specifies a Pmw.Balloon to display the help text for menu items. If None, no help is displayed. If the balloon has an associated Pmw.MessageBar, the help text will also be displayed there.

Due to a bug in some versions of Tk (8.0 and possible others), help text will not be displayed by the balloon. However, help text will be displayed in the balloon's associated messagebar. The default is None.

hotkeys
Initialisation option. If true, keyboard accelerators will be assigned to each menu item. Keyboard accelerators can be used to access the menus without using the mouse. The accelerator character is always one of the alphanumeric characters in the text label of the menu item and is indicated by an underline.

To select a menu, simultaneously press the <Alt> key and the accelerator character indicated on a toplevel menu item. The arrows keys can then be used to select other menus and menu items. To invoke a menu item, press <Return> or press the accelerator character indicated on the menu item.

Each accelerator character will be assigned automatically unless traverseSpec is supplied to the addmenu(), addmenuitem() or addcascademenu() methods. The automatically selected accelerator character for a menu item is the first character in the label text that has not already been used as an accelerator in the menu containing the menu item.

If traverseSpec is given, it must be either an integer or a character. If an integer, it specifies the index of the character in the label text to use as the accelerator character. If a character, it specifies the character to use as the accelerator character. The default is 1.

Components

Components created by this megawidget and its base classes are described below.

hull
The toplevel menu widget. By default, this component is a Tkinter.Menu.

Dynamic components

Menu components are created dynamically by the addmenu() and addcascademenu() methods. By default, these are of type Tkinter.Menu and are created with a component group of Menu.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaArchetype. In addition, methods from the Tkinter.Menu class are forwarded by this megawidget to the hull component.

addcascademenu(parentMenuName, menuName, statusHelp = '', traverseSpec = None, **kw)
Add a cascade menu (sub-menu) to the menu parentMenuName. The menuName argument must not be the same as any menu already created using the addmenu() or addcascademenu() methods.

A menu item in the parent menu is created (with the add_cascade() method of the parent menu) using all keyword arguments except tearoff and name.

If the label keyword argument is not given, the label option of the menu item defaults to menuName. If the underline keyword argument is not given (and the hotkeys megawidget option is true) the underline option is determined as described under hotkeys and is used to specify the keyboard accelerator.

The statusHelp argument is used as the help string for the menu item. This is displayed using the showstatus() method of the balloon.

The tearoff and name keyword arguments, if present, are passed to the constructor of the menu. See Tkinter.Menu for details of these options. The menu is created as a component named menuName.

addmenu(menuName, balloonHelp, statusHelp = None, traverseSpec = None, **kw)
Add a cascade menu to the toplevel menu. The menuName argument must not be the same as any menu already created using the addmenu() or addcascademenu() methods.

A menu item in the toplevel menu is created (with the add_cascade() method) using all keyword arguments except tearoff and name.

If the label keyword argument is not given, the label option of the menu button defaults to menuName. If the underline keyword argument is not given (and the hotkeys megawidget option is true) the underline option is determined as described under hotkeys and is used to specify the keyboard accelerator.

The statusHelp argument is used as the help string for the menu item. This is displayed using the showstatus() method of the balloon. Currently balloonHelp is not used, due to a bug in Tk version 8.0.

The tearoff and name keyword arguments, if present, are passed to the constructor of the menu. See Tkinter.Menu for details of these options. The menu is created as a component named menuName.

addmenuitem(menuName, itemType, statusHelp = '', traverseSpec = None, **kw)
Add a menu item to the menu menuName. The kind of menu item is given by itemType and may be one of command, separator, checkbutton, radiobutton or cascade (although cascade menus are better added using the addcascademenu() method). Any keyword arguments present will be passed to the menu when creating the menu item. See Tkinter.Menu for the valid options for each item type. In addition, a keyboard accelerator may be automatically given to the item, as described under hotkeys.

When the mouse is moved over the menu item, the helpString will be displayed by the balloon's statuscommand.

deletemenu(menuName)
Delete the menu menuName and all its items. The menu may either be a toplevel menu or a cascade menu.

deletemenuitems(menuName, start, end = None)
Delete menu items from the menu menuName. If end is not given, the start item is deleted. Otherwise all items from start to end are deleted.

disableall()
Disable all toplevel menus.

enableall()
Enable all toplevel menus.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create button to launch the toplevel with main menubar.
        w = Tkinter.Button(parent, text = 'Show Pmw.MainMenuBar demo',
                command = lambda parent=parent: MainMenuBarToplevel(parent))
        w.pack(padx = 8, pady = 8)

class MainMenuBarToplevel:
    def __init__(self, parent):
        # Create the toplevel to contain the main menubar.
        megaToplevel = Pmw.MegaToplevel(parent, title = title)
        toplevel = megaToplevel.interior()

        # Create the Balloon for this toplevel.
        self.balloon = Pmw.Balloon(toplevel)

        # Create and install the MenuBar.
        menuBar = Pmw.MainMenuBar(toplevel,
                balloon = self.balloon)
        toplevel.configure(menu = menuBar)
        self.menuBar = menuBar

        # Add some buttons to the MainMenuBar.
        menuBar.addmenu('File', 'Close this window or exit')
        menuBar.addmenuitem('File', 'command', 'Close this window',
                command = PrintOne('Action: close'),
                label = 'Close')
        menuBar.addmenuitem('File', 'separator')
        menuBar.addmenuitem('File', 'command', 'Exit the application',
                command = PrintOne('Action: exit'),
                label = 'Exit')

        menuBar.addmenu('Edit', 'Cut, copy or paste')
        menuBar.addmenuitem('Edit', 'command', 'Delete the current selection',
                command = PrintOne('Action: delete'),
                label = 'Delete')

        menuBar.addmenu('Options', 'Set user preferences')
        menuBar.addmenuitem('Options', 'command', 'Set general preferences',
                command = PrintOne('Action: general options'),
                label = 'General...')

        # Create a checkbutton menu item.
        self.toggleVar = Tkinter.IntVar()
        # Initialise the checkbutton to 1:
        self.toggleVar.set(1)
        menuBar.addmenuitem('Options', 'checkbutton', 'Toggle me on/off',
                label = 'Toggle',
                command = self._toggleMe,
                variable = self.toggleVar)
        self._toggleMe()

        menuBar.addcascademenu('Options', 'Size',
                'Set some other preferences', traverseSpec = 'z', tearoff = 1)
        for size in ('tiny', 'small', 'average', 'big', 'huge'):
            menuBar.addmenuitem('Size', 'command', 'Set size to ' + size,
                    command = PrintOne('Action: size ' + size),
                    label = size)

        menuBar.addmenu('Help', 'User manuals', name = 'help')
        menuBar.addmenuitem('Help', 'command', 'About this application',
                command = PrintOne('Action: about'),
                label = 'About...')

        # Create and pack the main part of the window.
        self.mainPart = Tkinter.Label(toplevel,
                text = 'This is the\nmain part of\nthe window',
                background = 'black',
                foreground = 'white',
                padx = 30,
                pady = 30)
        self.mainPart.pack(fill = 'both', expand = 1)

        # Create and pack the MessageBar.
        self.messageBar = Pmw.MessageBar(toplevel,
                entry_width = 40,
                entry_relief='groove',
                labelpos = 'w',
                label_text = 'Status:')
        self.messageBar.pack(fill = 'x', padx = 10, pady = 10)
        self.messageBar.message('state',
            'Balloon/status help not working properly - Tk menubar bug')

        buttonBox = Pmw.ButtonBox(toplevel)
        buttonBox.pack(fill = 'x')
        buttonBox.add('Disable\nall', command = menuBar.disableall)
        buttonBox.add('Enable\nall', command = menuBar.enableall)
        buttonBox.add('Create\nmenu', command = self.add)
        buttonBox.add('Delete\nmenu', command = self.delete)
        buttonBox.add('Create\nitem', command = self.additem)
        buttonBox.add('Delete\nitem', command = self.deleteitem)

        # Configure the balloon to displays its status messages in the
        # message bar.
        self.balloon.configure(statuscommand = self.messageBar.helpmessage)

        self.testMenuList = []

    def _toggleMe(self):
        print 'Toggle value:', self.toggleVar.get()

    def add(self):
        if len(self.testMenuList) == 0:
            num = 0
        else:
            num = self.testMenuList[-1]
        num = num + 1
        name = 'Menu%d' % num
        self.testMenuList.append(num)

        self.menuBar.addmenu(name, 'This is ' + name)

    def delete(self):
        if len(self.testMenuList) == 0:
            self.menuBar.bell()
        else:
            num = self.testMenuList[0]
            name = 'Menu%d' % num
            del self.testMenuList[0]
            self.menuBar.deletemenu(name)

    def additem(self):
        if len(self.testMenuList) == 0:
            self.menuBar.bell()
        else:
            num = self.testMenuList[-1]
            menuName = 'Menu%d' % num
            menu = self.menuBar.component(menuName)
            if menu.index('end') is None:
                label = 'item X'
            else:
                label = menu.entrycget('end', 'label') + 'X'
            self.menuBar.addmenuitem(menuName, 'command', 'Help for ' + label,
                    command = PrintOne('Action: ' + menuName + ': ' + label),
                    label = label)
            
    def deleteitem(self):
        if len(self.testMenuList) == 0:
            self.menuBar.bell()
        else:
            num = self.testMenuList[-1]
            menuName = 'Menu%d' % num
            menu = self.menuBar.component(menuName)
            if menu.index('end') is None:
                self.menuBar.bell()
            else:
                self.menuBar.deletemenuitems(menuName, 0)
            
class PrintOne:
    def __init__(self, text):
        self.text = text

    def __call__(self):
        print self.text

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 22 April 2000

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MegaArchetype.html0000644000175000017500000005251210656147112020341 0ustar serge2serge2 Pmw.MegaArchetype reference manual

Pmw.MegaArchetype

Name

Pmw.MegaArchetype() - abstract base class for all Pmw megawidgets

Description

This class is the basis for all Pmw megawidgets. It provides methods to manage options and component widgets.

This class is normally used as a base class for other classes. If the hullClass argument is specified, such as in the Pmw.MegaWidget and Pmw.MegaToplevel classes, a container widget is created to act as the parent of all other component widgets. Classes derived from these sub classes create other component widgets and options to implement megawidgets that can be used in applications.

If no hullClass argument is given to the constructor, no container widget is created and only the option configuration functionality is available.

Components

A megawidget is generally made up of other widgets packed within the megawidget's containing widget. These sub-widgets are called the components of the megawidget and are given logical names for easy reference. The component mechanism allows the user of a megawidget to gain controlled access to some of the internals of the megawidget, for example to call a method of a component or to set a component's configuration options.

Sub components: If a component is itself a megawidget containing sub-components, then these sub-components can be referred to using the notation component_subcomponent. For example, Pmw.ComboBox has a component named entryfield which is an instance of Pmw.EntryField, which itself has a Tkinter.Entry component named entry. In the context of the combobox, this entry widget can be referred to as entryfield_entry.

Component aliases: Because the sub-component notation may make component names inconveniently long, components and sub-components can be aliased to simpler names. For example, the entryfield_entry sub-component of Pmw.ComboBox is aliased to simply entry. If there is no conflict in component names, sub-component names are usually aliased to the name of the "leaf" component.

Component groups: Similar components of a megawidget can be given a group name, which allows all components of a group to be referenced using the one group name. For example, the two arrow components of Pmw.Counter have a group name of Arrow. Also, megawidgets that can create an unlimited number of similar components, such as Pmw.ButtonBox, create each of these components with the same group name. By convention, group names begin with a capital letter.

Options

A megawidget defines options which allow the megawidget user to modify the appearance and behaviour of the megawidget. Using the same technique as Tkinter widgets, the values of megawidget options may be set in calls to the constructor and to configure() and the values may be queried by calls to cget() and configure(). Like Tkinter widgets, megawidget options are initialised with default values. Also, if the useTkOptionDb option to Pmw.initialise() has been set, then the Tk option database will be queried to get the initial values. Strings found in the option database are converted to python objects (integer, float, tuple, dictionary, etc) using a restricted eval() call. Anything that is not accepted by eval() is treated as a string.

Inherited options: As well as the options defined in a class, a derived class inherits all options of its base classes. The default value of an option defined by a base class may be modified by the derived class.

Initialisation options: Some megawidget options can only be set in the call to the constructor. These are called initialisation options. Unlike normal configuration options, they cannot be set by calling the configure() method.

Component options: Options of the components of a megawidget can be referred to using the notation component_option. Like the megawidget options, component options can be used in calls to the constructor and to the cget() and configure() methods. For example, the state option of the Tkinter.Text text component of Pmw.ScrolledText may be set by calling

 widget.configure(text_state = 'disabled')

Sub-components, component aliases and component groups may also be combined with options. For example, the state option of the entryfield_entry component of Pmw.ComboBox may be set by calling

 combobox.configure(entryfield_entry_state = 'normal')

Since it has an alias, it is more convenient to use the equivalent form

 combobox.configure(entry_state = 'normal')

Also, the background color of both arrows of Pmw.Counter can be set using the Arrow component group.

 counter.configure(Arrow_background = 'aliceblue')

The pyclass component option

The pyclass component option is a special notation that can be used to specify a non-default python class for a component. This can only be used when the component is being constructed. For a component created during the construction of its parent megawidget, this option must be given to the constructor in the form component_pyclass. For example, to change the python class of the text sub-component of Pmw.TextDialog to a class FontText.Text

 dialog = Pmw.TextDialog(text_pyclass = FontText.Text)

For components created after the construction of the parent megawidget, the pyclass option must be passed into the method which constructs the component. For example, to set the python class of a button in Pmw.ButtonBox to a class MyButton:

 buttonBox.add('special', pyclass = MyButton)

The new python class of the component must support all methods and options that are used by the megawidget when operating on the component. The exact interface required for each component is not documented. You will have to examine the Pmw source code. However, any class derived from the default class of a component can be used as the new class of the component, as long as all of the original methods and options are still supported. For example, any class derived from Tkinter.Text can be used as the class of the text sub-component of Pmw.TextDialog.

The pyclass component option should not be confused with the class option that some of the Tk widgets support. The class option sets the Tk option database class for the widget and is used by Tk to query the database for the default values of the widget's other options. The name pyclass was chosen so that it did not conflict with any known Tk options.

Construction

The constructors of classes derived from this class all accept the same arguments: one positional argument and any number of keyword arguments. The positional argument defaults to None (meaning the root window) and specifies the widget to use as the parent when creating the megawidget's hull component. The keyword arguments define initial values for options. The format for the constructors of derived classes is:

   def __init__(self, parent = None, **kw):

Methods

addoptions(optionDefs)
Add additional options for this megawidget. The optionDefs argument is treated in the same way as for the defineoptions() method.

This method is for use by derived classes. It is only used if a megawidget should conditionally define some options, perhaps depending on the value of other options. Usually, megawidgets unconditionally define all their options in the call to defineoptions() and do not need to use addoptions(). This method must be called after the call to defineoptions() and before the call to initialiseoptions().

cget(option)
Return the current value of option (which should be in the format described in the Options section). This method is also available using object subscripting, for example myWidget['font']. Unlike Tkinter's cget(), which always returns a string, this method returns the same value and type as used when the option was set (except where option is a component option and the component is a Tkinter widget, in which case it returns the string returned by Tcl/Tk).

component(name)
Return the component widget whose name is name. This allows the user of a megawidget to access and configure component widgets directly.

componentaliases()
Return the list of aliases for components. Each item in the list is a tuple whose first item is the name of the alias and whose second item is the name of the component or sub-component it refers to.

componentgroup(name)
Return the group of the component whose name is name or None if it does not have a group.

components()
Return a sorted list of names of the components of this megawidget.

configure(option = None, **kw)
Query or configure the megawidget options.

If no arguments are given, return a tuple consisting of all megawidget options and values, each as a 5-element tuple (name, resourceName, resourceClass, default, value). This is in the same format as the value returned by the standard Tkinter configure() method, except that the resource name is always the same as the option name and the resource class is the option name with the first letter capitalised.

If one argument is given, return the 5 element tuple for option.

Otherwise, set the configuration options specified by the keyword arguments. Each key should be in the format described in the Options section.

createcomponent(componentName, componentAliases, componentGroup, widgetClass, *widgetArgs, **kw)
Create a component widget by calling widgetClass with the arguments given by widgetArgs and any keyword arguments. The componentName argument is the name by which the component will be known and must not contain the underscore, '_', character. The componentGroup argument specifies the group of the component. The componentAliases argument is a sequence of 2-element tuples, whose first item is an alias name and whose second item is the name of the component or sub-component it is to refer to.

If this method is called during megawidget construction, any component options supplied to the megawidget constructor which refer to this component (by componentName or componentGroup) are added to the kw dictionary before calling widgetClass. If the dictionary contains a 'pyclass' key, then this item is removed from the dictionary and the value is used instead of widgetClass. For more details see The pyclass component option section.

This method may be called by derived classes during or after megawidget construction. It returns the instance of the class created.

createlabel(parent, childCols = 1, childRows = 1)
Create a Tkinter.Label component named 'label' in the parent widget. This is a convenience method used by several megawidgets that require an optional label. The widget must have options named labelpos and labelmargin. If labelpos is None, no label is created. Otherwise, a label is created and positioned according to the value of labelpos and labelmargin. The label is added to the parent using the grid() method, with childCols and childRows indicating how many rows and columns the label should span. Note that all other child widgets of the parent must be added to the parent using the grid() method. The createlabel() method may be called by derived classes during megawidget construction.

defineoptions(keywords, optionDefs, dynamicGroups = ())
Create options for this megawidget. The optionDefs argument defines the options. It is a sequence of 3-element tuples, (name, default, callback), where name is the name of the option, default is its default value and callback is the function to call when the value of the option is set by a call to configure(). The keywords argument should be the keyword arguments passed in to the constructor of the megawidget. The user may override the default value of an option by supplying a keyword argument to the constructor.

If any option created by a base class is also defined by optionDefs, then the derived class's default value will take precedence over the base class's. If the callback field is not None, then this will also override the callback set by the base class.

If callback is Pmw.INITOPT, then the option is an initialisation option.

The dynamicGroups argument contains a list of the groups of the components created dynamically by this megawidget. If a group is included in this list, then it not an error if a keyword argument for the group is given to the constructor or to configure(), even when no components with this group have been created.

If defineoptions() is called, it must be called once in the megawidget constructor before the call to the constructor of the base class and there must be a matching call to initialiseoptions() at the end of the constructor.

destroy()
Destroy the hull component widget, if it exists, including all of its children.

destroycomponent(name)
Remove the megawidget component called name. This method may be called by derived classes to destroy a megawidget component. It destroys the component widget and then removes all record of the component from the megawidget.

hulldestroyed()
Return true if the Tk widget corresponding to the hull component has been destroyed.

initialiseoptions(dummy = None)
Check keyword arguments and call option callback functions. This method must be called, at the end of a megawidget constructor, if and only if defineoptions() was also called in the constructor. The dummy argument is not required, but is retained for backwards compatibility.

It checks that all keyword arguments given to the constructor have been used. If not, it raises an error indicating which arguments were unused. A keyword is defined to be used if, during the construction of a megawidget, it is defined in a call to defineoptions() or addoptions() (by the megawidget or one of its base classes), or it references, by name, a component of the megawidget, or it references, by group, at least one component. It also calls the configuration callback function for all options that have a callback.

This method is only effective when called by the constructor of the leaf class, that is, the class in the class hierarchy which first called defineoptions(). For all other classes in the class hierarchy (base classes), the method returns immediately.

interior()
Return the widget framing the interior space in which any children of this megawidget should be created. By default, this returns the hull component widget, if one was created, or None otherwise. A subclass should use the widget returned by interior() as the parent of any components or sub-widgets it creates. Megawidgets which can be further subclassed, such as Pmw.Dialog, should redefine this method to return the widget in which subclasses should create children. The overall containing widget is always available as the hull component.

isinitoption(option)
If option is an initialisation option, return true. Otherwise, return false (the option is a configuration option). The option argument must be an option of this megawidget, not an option of a component. Otherwise an exception is raised.

options()
Return a sorted list of this megawidget's options. Each item in the list is a 3-element tuple, (option, default, isinit), where option is the name of the option, default is its default value and isinit is true if the option is an initialisation option.

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 22 May 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MegaToplevel.html0000644000175000017500000002601010656147112020201 0ustar serge2serge2 Pmw.MegaToplevel reference manual

Pmw.MegaToplevel

Name

Pmw.MegaToplevel() - base class for megawidgets within a toplevel

Inherits

Pmw.MegaArchetype

Description

This class creates a megawidget contained within a toplevel window. It may be used directly to create a toplevel megawidget or it may be used as a base class for more specialised toplevel megawidgets, such as Pmw.Dialog. It creates a Tkinter.Toplevel component, named hull, to act as the container of the megawidget. The window class name for the hull widget is set to the most-specific class name for the megawidget. Derived classes specialise this class by creating other widget components as children of the hull widget.

The megawidget may be used as either a normal toplevel window or as a modal dialog. Use show() and withdraw() for normal use and activate() and deactivate() for modal dialog use. If the window is deleted by the window manager while being shown normally, the default behaviour is to destroy the window. If the window is deleted by the window manager while the window is active (ie: when used as a modal dialog), the window is deactivated. Use the userdeletefunc() and usermodaldeletefunc() methods to override these behaviours. Do not call protocol() to set the WM_DELETE_WINDOW window manager protocol directly if you want to use this window as a modal dialog.

The currently active windows form a stack with the most recently activated window at the top of the stack. All mouse and keyboard events are sent to this top window. When it deactivates, the next window in the stack will start to receive events.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is None.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaArchetype. In addition, methods from the Tkinter.Toplevel class are forwarded by this megawidget to the hull component.

activate(globalMode = 0, geometry = 'centerscreenfirst')
Display the window as a modal dialog. This means that all mouse and keyboard events go to this window and no other windows can receive any events. If you do not want to restrict mouse and keyboard events to this window, use the show() method instead.

If the BLT extension to Tk is present, a busy cursor will be displayed on other toplevel windows, using Pmw.showbusycursor().

The activate() method does not return until the deactivate() method is called, when the window is withdrawn, the grab released and the result returned.

If globalMode is false, the window will grab control of the pointer and keyboard, preventing any events from being delivered to any other toplevel windows within the application. If globalMode is true, the grab will prevent events from being delivered to any other toplevel windows regardless of application. Global grabs should be used sparingly, if at all.

If globalMode is 'nograb', then no grab is performed. If BLT is present, this will allow mouse and keyboard events to be received by other windows whose exclude busycursor attribute has been set to true by a call to Pmw.setbusycursorattributes(). Note that if 'nograb' is used and BLT is not present, then all other windows will receive mouse and keyboard events. This is because, in plain Tk, there is no way to specify that two windows (only) receive events. If your application may be used without BLT, then do not use 'nograb'.

When the window is displayed, it is positioned on the screen according to geometry which may be one of:

centerscreenfirst
The window will be centered the first time it is activated. On subsequent activations it will be positioned in the same position as the last time it was displayed, even if it has been moved by the user.

centerscreenalways
The window will be be centered on the screen (halfway across and one third down).

first + spec
It is assumed that the rest of the argument (after 'first') is a standard geometry specification. The window will be positioned using this specification the first time it is activated. On subsequent activations it will be positioned in the same position as the last time it was displayed, even if it has been moved by the user. For example, geometry = first+100+100 will initially display the window at position (100,100). Other calls to activate() will not change the previous position of the window.

spec
This is a standard geometry specification. The window will be be positioned using this specification.

If the BLT Tcl extension library is present, a clock cursor will be displayed until the window is deactivated.

If the activatecommand option is callable, it is called just before the window begins to wait for the result.

If the master option is not None, the window will become a transient window of master, which should be a toplevel window. If master has the special value of 'parent', the master is the toplevel window of the window's parent.

active()
Return true if the megawidget is currently active (that is, activate() is currently waiting for a result to be passed to it by a call to deactivate()).

deactivate(result = None)
This should be called while a call to activate() is waiting. It will withdraw the window, release the grab and cause the activate() call to return with the value of result.

If the deactivatecommand option is callable, it is called just before the deactivate() method returns.

destroy()
Destroy the hull component widget, including all of its children. If the megawidget is currently active, deactivate it.

show(master = None)
Make the window visible. This raises or deiconifies the toplevel window. If the window has previously been shown it will remain in the same position. This means that calling withdraw() then show() will not move the window, whereas calling withdraw() then deiconify() may change the window's position. (This may depend on the behaviour of the window manager.)

userdeletefunc(func = None)
If func is None, return the function that will be called when the window is deleted by the window manager while being displayed normally. If func is not None, set this function to func. By default, the function is self.destroy.

usermodaldeletefunc(func = None)
If func is None, return the function that will be called when the window is deleted by the window manager while it is active (ie: when being used as a modal dialog). If func is not None, set this function to func. By default, the function is self.deactivate.

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 22 May 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MegaWidget.html0000644000175000017500000000472010656147112017636 0ustar serge2serge2 Pmw.MegaWidget reference manual

Pmw.MegaWidget

Name

Pmw.MegaWidget() - base class for megawidgets within a frame

Inherits

Pmw.MegaArchetype

Description

This class creates a megawidget contained within a Tkinter.Frame window. The class acts as the base class for megawidgets that are not contained in their own toplevel window, such as Pmw.ButtonBox and Pmw.ComboBox. It creates a Tkinter.Frame component, named hull, to act as the container of the megawidget. The window class name for the hull widget is set to the most-specific class name for the megawidget. Derived classes specialise this class by creating other widget components as children of the hull widget.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

Methods

This megawidget has no methods of its own. For a description of its inherited methods, see the manual for its base class Pmw.MegaArchetype. In addition, methods from the Tkinter.Frame class are forwarded by this megawidget to the hull component.

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 22 May 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MenuBar.html0000644000175000017500000003743610656147112017164 0ustar serge2serge2 Pmw.MenuBar reference manual

Pmw.MenuBar

Name

Pmw.MenuBar() - manager megawidget for menu buttons and menus

Inherits

Pmw.MegaWidget

Description

A menu bar is a container megawidget which manages a number of menu buttons and dropdown menus. There are methods to add menu buttons and menus to the menu bar and for adding menu items to the menus. Menu buttons may be added to the left or right of the megawidget. Each menu button and menu item may have help text to be displayed by a Pmw.Balloon. Each menu and cascaded menu (sub-menu) is referenced by name which is supplied on creation.

Options

Options for this megawidget and its base classes are described below.

balloon
Specifies a Pmw.Balloon to display the help text for menu buttons and menu items. If None, no help is displayed. If the balloon has an associated Pmw.MessageBar, the help text will also be displayed there. The default is None.

hotkeys
Initialisation option. If true, keyboard accelerators will be assigned to each menu button and menu item. Keyboard accelerators can be used to access the menus without using the mouse. The accelerator character is always one of the alphanumeric characters in the text label of the menu or menu item and is indicated by an underline.

To select a menu, simultaneously press the <Alt> key and the accelerator character indicated on a menu button. The arrows keys can then be used to select other menus and menu items. To invoke a menu item, press <Return> or press the accelerator character indicated on the menu item.

Each accelerator character will be assigned automatically unless traverseSpec is supplied to the addmenu(), addmenuitem() or addcascademenu() methods. The automatically selected accelerator character for a menu button (or menu item) is the first character in the label text that has not already been used as an accelerator for a menu button (or in the menu containing the menu item).

If traverseSpec is given, it must be either an integer or a character. If an integer, it specifies the index of the character in the label text to use as the accelerator character. If a character, it specifies the character to use as the accelerator character. The default is 1.

padx
Initialisation option. Specifies a padding distance to leave between each menu button in the x direction and also between the menu buttons and the outer edge of the menu bar. The default is 0.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

Dynamic components

Menu button components are created dynamically by the addmenu() method. By default, these are of type Tkinter.Menubutton and are created with a component group of Button.

Menu components are created dynamically by the addmenu() and addcascademenu() methods. By default, these are of type Tkinter.Menu and are created with a component group of Menu.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

addcascademenu(parentMenuName, menuName, statusHelp = '', traverseSpec = None, **kw)
Add a cascade menu (sub-menu) to the menu parentMenuName. The menuName argument must not be the same as any menu already created using the addmenu() or addcascademenu() methods.

A menu item in the parent menu is created (with the add_cascade() method of the parent menu) using all keyword arguments except tearoff.

If the label keyword argument is not given, the label option of the menu item defaults to menuName. If the underline keyword argument is not given (and the hotkeys megawidget option is true) the underline option is determined as described under hotkeys and is used to specify the keyboard accelerator.

The statusHelp argument is used as the help string for the menu item. This is displayed using the showstatus() method of the balloon.

The tearoff keyword argument, if present, is passed to the constructor of the menu. The menu is created as a component named menuName-menu.

addmenu(menuName, balloonHelp, statusHelp = None, side = 'left', traverseSpec = None, **kw)
Add a menu button and its associated menu to the menu bar. The menuName argument must not be the same as any menu already created using the addmenu() or addcascademenu() methods.

Any keyword arguments present (except tearoff) will be passed to the constructor of the menu button. If the text keyword argument is not given, the text option of the menu button defaults to menuName. If the underline keyword argument is not given (and the hotkeys megawidget option is true) the underline option is determined as described under hotkeys and is used to specify the keyboard accelerator. Each menu button is packed into the menu bar using the given side, which should be either left or right. The menu button is created as a component named menuName-button.

If the balloon option has been defined, balloonHelp and statusHelp are passed to the balloon as the help strings for the menu button. See the bind() method of Pmw.Balloon for how these strings may be displayed.

The tearoff keyword argument, if present, is passed to the constructor of the menu. The menu is created as a component named menuName-menu.

addmenuitem(menuName, itemType, statusHelp = '', traverseSpec = None, **kw)
Add a menu item to the menu menuName. The kind of menu item is given by itemType and may be one of command, separator, checkbutton, radiobutton or cascade (although cascade menus are better added using the addcascademenu() method). Any keyword arguments present will be passed to the menu when creating the menu item. See Tkinter.Menu for the valid options for each item type. In addition, a keyboard accelerator may be automatically given to the item, as described under hotkeys.

When the mouse is moved over the menu item, the helpString will be displayed by the balloon's statuscommand.

deletemenu(menuName)
Delete the menu menuName and all its items. The menu may either be a toplevel menu (in which case the corresponding menu button is also deleted) or a cascade menu.

deletemenuitems(menuName, start, end = None)
Delete menu items from the menu menuName. If end is not given, the start item is deleted. Otherwise all items from start to end are deleted.

disableall()
Disable all toplevel menus.

enableall()
Enable all toplevel menus.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the Balloon.
        self.balloon = Pmw.Balloon(parent)

        # Create and pack the MenuBar.
        menuBar = Pmw.MenuBar(parent,
                hull_relief = 'raised',
                hull_borderwidth = 1,
                balloon = self.balloon)
        menuBar.pack(fill = 'x')
        self.menuBar = menuBar

        # Add some buttons to the MenuBar.
        menuBar.addmenu('File', 'Close this window or exit')
        menuBar.addmenuitem('File', 'command', 'Close this window',
                command = PrintOne('Action: close'),
                label = 'Close')
        menuBar.addmenuitem('File', 'separator')
        menuBar.addmenuitem('File', 'command', 'Exit the application',
                command = PrintOne('Action: exit'),
                label = 'Exit')

        menuBar.addmenu('Edit', 'Cut, copy or paste')
        menuBar.addmenuitem('Edit', 'command', 'Delete the current selection',
                command = PrintOne('Action: delete'),
                label = 'Delete')

        menuBar.addmenu('Options', 'Set user preferences')
        menuBar.addmenuitem('Options', 'command', 'Set general preferences',
                command = PrintOne('Action: general options'),
                label = 'General...')

        # Create a checkbutton menu item.
        self.toggleVar = Tkinter.IntVar()
        # Initialise the checkbutton to 1:
        self.toggleVar.set(1)
        menuBar.addmenuitem('Options', 'checkbutton', 'Toggle me on/off',
                label = 'Toggle',
                command = self._toggleMe,
                variable = self.toggleVar)
        self._toggleMe()

        menuBar.addcascademenu('Options', 'Size',
                'Set some other preferences', traverseSpec = 'z', tearoff = 1)
        for size in ('tiny', 'small', 'average', 'big', 'huge'):
            menuBar.addmenuitem('Size', 'command', 'Set size to ' + size,
                    command = PrintOne('Action: size ' + size),
                    label = size)

        menuBar.addmenu('Help', 'User manuals', side = 'right')
        menuBar.addmenuitem('Help', 'command', 'About this application',
                command = PrintOne('Action: about'),
                label = 'About...')

        # Create and pack the main part of the window.
        self.mainPart = Tkinter.Label(parent,
                text = 'This is the\nmain part of\nthe window',
                background = 'black',
                foreground = 'white',
                padx = 30,
                pady = 30)
        self.mainPart.pack(fill = 'both', expand = 1)

        # Create and pack the MessageBar.
        self.messageBar = Pmw.MessageBar(parent,
                entry_width = 40,
                entry_relief='groove',
                labelpos = 'w',
                label_text = 'Status:')
        self.messageBar.pack(fill = 'x', padx = 10, pady = 10)
        self.messageBar.message('state', 'OK')

        buttonBox = Pmw.ButtonBox(parent)
        buttonBox.pack(fill = 'x')
        buttonBox.add('Disable\nall', command = menuBar.disableall)
        buttonBox.add('Enable\nall', command = menuBar.enableall)
        buttonBox.add('Create\nmenu', command = self.add)
        buttonBox.add('Delete\nmenu', command = self.delete)
        buttonBox.add('Create\nitem', command = self.additem)
        buttonBox.add('Delete\nitem', command = self.deleteitem)

        # Configure the balloon to displays its status messages in the
        # message bar.
        self.balloon.configure(statuscommand = self.messageBar.helpmessage)

        self.testMenuList = []

    def _toggleMe(self):
        print 'Toggle value:', self.toggleVar.get()

    def add(self):
        if len(self.testMenuList) == 0:
            num = 0
        else:
            num = self.testMenuList[-1]
        num = num + 1
        name = 'Menu%d' % num
        self.testMenuList.append(num)

        self.menuBar.addmenu(name, 'This is ' + name)

    def delete(self):
        if len(self.testMenuList) == 0:
            self.menuBar.bell()
        else:
            num = self.testMenuList[0]
            name = 'Menu%d' % num
            del self.testMenuList[0]
            self.menuBar.deletemenu(name)

    def additem(self):
        if len(self.testMenuList) == 0:
            self.menuBar.bell()
        else:
            num = self.testMenuList[-1]
            menuName = 'Menu%d' % num
            menu = self.menuBar.component(menuName + '-menu')
            if menu.index('end') is None:
                label = 'item X'
            else:
                label = menu.entrycget('end', 'label') + 'X'
            self.menuBar.addmenuitem(menuName, 'command', 'Help for ' + label,
                    command = PrintOne('Action: ' + menuName + ': ' + label),
                    label = label)
            
    def deleteitem(self):
        if len(self.testMenuList) == 0:
            self.menuBar.bell()
        else:
            num = self.testMenuList[-1]
            menuName = 'Menu%d' % num
            menu = self.menuBar.component(menuName + '-menu')
            if menu.index('end') is None:
                self.menuBar.bell()
            else:
                self.menuBar.deletemenuitems(menuName, 0)
            
class PrintOne:
    def __init__(self, text):
        self.text = text

    def __call__(self):
        print self.text

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 22 April 2000

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MessageBar.html0000644000175000017500000002673310656147112017642 0ustar serge2serge2 Pmw.MessageBar reference manual

Pmw.MessageBar

Name

Pmw.MessageBar() - information line for displaying short messages

Inherits

Pmw.MegaWidget

Description

A message bar contains a single-line message display area. Messages of several different types may displayed. Messages are cleared after a period defined for each message type. Each message type has a priority so that if the application attempts to display more than one message at a time, the message with the highest priority will be displayed. Messages may be accompanied by a number of audible bells.

This megawidget can be used for both interactive help messages (when the mouse enters certain widgets) and also for other general messages.

To perform the help function it can cooperate with the Pmw.Balloon megawidget so that the programmer (or user) can choose either balloon help, message bar help, both or neither.

This megawidget supports a configurable number of message types. The default types include 'state', 'help', 'usererror' and 'systemerror'. The difference between these are the length of time they are displayed, the number of bells that are rung and the priority of the message. For example, the 'help' message type is lower in priority than the 'usererror', so that error messages will always be displayed in preference to help messages regardless of the order the messages are created. The 'state' message type is lowest in priority but has no timeout, so it should contain messages describing the current state of the application, such as Waiting for database connection or 'Waiting for file to be unlocked'. Generally this should be set to the empty string when the application is running normally. By default the help messages (with message type 'help') time out after 5 seconds, so that if the cursor happens to be left over a widget, the application state will be redisplayed after a short time.

Options

Options for this megawidget and its base classes are described below.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

messagetypes
Initialisation option. This defines what message types are supported by the message bar and the characteristics of those message types. It is a dictionary where the key is a string specifying a message type and the value is a tuple of four integers, (priority, showtime, bells, logmessage), where priority is the rank of the message type, showtime is the number of seconds to display messages of this message type, bells is the number of audible bells to ring and logmessage is a boolean specifying whether this message should be logged for retrieval later. Messages with a higher priority are displayed in preference to those with lower priority. If a high priority message times out (because it has been displayed for showtime seconds), then a lower priority message may be displayed. A showtime of 0 means that the message will never time out and is useful for displaying messages describing the current state of the application as opposed to messages describing events. Logging is not currently implemented. The default is

 {
     'systemerror'  : (5, 10, 2, 1),
     'usererror'    : (4, 5, 1, 0),
     'busy'         : (3, 0, 0, 0),
     'systemevent'  : (2, 5, 0, 0),
     'userevent'    : (2, 5, 0, 0),
     'help'         : (1, 5, 0, 0),
     'state'        : (0, 0, 0, 0),
 }
silent
If true, no audible bells will sound, regardless of the value for bells defined in the messagetypes option. The default is 0.

sticky
Initialisation option. The default is 'ew'.

Components

Components created by this megawidget and its base classes are described below.

entry
The widget where the messages are displayed. Long messages may be scrolled horizontally by dragging with the middle mouse button. By default, this component is a Tkinter.Entry.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the Tkinter.Entry class are forwarded by this megawidget to the entry component.

helpmessage(text)
A convenience method to display text in the message bar according to the characteristics defined by the help message type. Equivalent to message('help', text).

message(type, text)
Display text in the message bar according to the characteristics defined by the type message type, as discussed under messagetypes.

resetmessages(type)
Clear the type message and all message types with a lower priority, except permanent messages, such as state. This is useful to clear the busy message and any outstanding event and help messages.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack the MessageBar.
        self._messagebar = Pmw.MessageBar(parent,
                entry_width = 40,
                entry_relief='groove',
                labelpos = 'w',
                label_text = 'Status:')
        self._messagebar.pack(side = 'bottom', fill = 'x',
                expand = 1, padx = 10, pady = 10)

        # Create and pack the ScrolledListBox to change the MessageBar.
        self.box = Pmw.ScrolledListBox(parent,
                listbox_selectmode='single',
                items=('state', 'help', 'userevent', 'systemevent',
                        'usererror', 'systemerror', 'busy',),
                label_text='Message type',
                labelpos='n',
                selectioncommand=self.selectionCommand)
        self.box.pack(fill = 'both', expand = 'yes', padx = 10, pady = 10)

        self._index = 0
        self._stateCounter = 0

    def selectionCommand(self):
        sels = self.box.getcurselection()
        if len(sels) > 0:
            self._index = self._index + 1
            messagetype = sels[0]
            if messagetype == 'state':
                self._stateCounter = (self._stateCounter + 1) % 3
                text = stateMessages[self._stateCounter]
                if text != '':
                    text = text + ' (' + messagetype + ')'
                self._messagebar.message('state', text)
            else:
                text = messages[messagetype]
                text = text + ' (' + messagetype + ')'
                self._messagebar.message(messagetype, text)
                if messagetype == 'busy':
                    Pmw.showbusycursor()
                    self.box.after(2000)
                    Pmw.hidebusycursor()
                    self._messagebar.resetmessages('busy')
                    text = 'All files successfully removed'
                    text = text + ' (userevent)'
                    self._messagebar.message('userevent', text)


messages = {
    'help': 'Save current file',
    'userevent': 'Saving file "foo"',
    'busy': 'Busy deleting all files from file system ...',
    'systemevent': 'File "foo" saved',
    'usererror': 'Invalid file name "foo/bar"',
    'systemerror': 'Failed to save file: file system full',
}

stateMessages = {
    0: '',
    1: 'Database is down',
    2: 'Waiting for reply from database',
}

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MessageDialog.html0000644000175000017500000002611210656147112020324 0ustar serge2serge2 Pmw.MessageDialog reference manual

Pmw.MessageDialog

Name

Pmw.MessageDialog() - a dialog displaying a text message and an icon

Inherits

Pmw.Dialog

Description

A message dialog is a dialog window which displays a simple message to the user along with one or more buttons to press.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

borderx
Initialisation option. The padding to the left and right of the text message and icon. The default is 20.

bordery
Initialisation option. The padding above and below the text message and icon. The default is 20.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('OK',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is None.

iconmargin
Initialisation option. The padding between the text message and icon. The default is 20.

iconpos
Initialisation option. Specifies on which side of the text message to place the icon. Must be one of 'n', 's', 'e' or 'w'. The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

icon
If the iconpos option is not None, this component is created to contain the icon label for the dialog. To display a bitmap as an icon, set the icon_bitmap component option to any of the forms acceptable to Tk, such as 'warning' or 'error'. By default, this component is a Tkinter.Label.

message
The label to contain the text message for the dialog. To set the text, use the message_text component option. By default, this component is a Tkinter.Label.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Methods

This megawidget has no methods of its own. For a description of its inherited methods, see the manual for its base class Pmw.Dialog.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        self.parent = parent

        # Create dialog 1.
        self.dialog1 = Pmw.MessageDialog(parent,
            title = 'Simple message dialog',
            defaultbutton = 0,
            message_text = 'A simple message dialog\nwith no callback.')
        self.dialog1.iconname('Simple message dialog')
        self.dialog1.withdraw()

        # Create dialog 2.
        self.dialog2 = Pmw.MessageDialog(parent,
            title = 'Bell ringing dialog',
            message_text = 'This message dialog\nwill ring the bell ' +
                'when\nyou click on the buttons.',
            iconpos = 'w',
            icon_bitmap = 'error',
            command = self.execute2,
            buttons = ('One', 'Two', 'Three', 'Close'))
        self.dialog2.iconname('Bell ringing dialog')
        self.dialog2.withdraw()

        # Create dialog 3.
        self.dialog3 = Pmw.MessageDialog(parent,
            title = 'Vertical button dialog',
            message_text = 'This message dialog\nhas the buttons on the\n' +
                'right hand side.',
            buttonboxpos = 'e',
            iconpos = 'n',
            icon_bitmap = 'warning',
            buttons = ('Goodbye', 'Au revoir', 'Sayonara', 'Close'),
            defaultbutton = 'Close')
        self.dialog3.iconname('Vertical button dialog')
        self.dialog3.withdraw()

        # Create some buttons to launch the dialogs.
        w = Tkinter.Button(parent, text = 'Simple dialog',
                command = lambda self = self:
                        self.dialog1.activate(geometry = 'first+100+100'))
        w.pack(padx = 8, pady = 8)

        w = Tkinter.Button(parent, text = 'Bell ringing dialog',
                command = self.dialog2.activate)
        w.pack(padx = 8, pady = 8)

        w = Tkinter.Button(parent, text = 'Vertical buttons',
                command = self.dialog3.activate)
        w.pack(padx = 8, pady = 8)

        w = Tkinter.Button(parent, text = 'On the fly dialog',
                command = self._createOnTheFly)
        w.pack(padx = 8, pady = 8)

    def execute2(self, result):
        print 'You clicked on', result
        if result is None:
            self.dialog2.deactivate(result)
        elif result == 'Close':
            self.dialog2.deactivate(result)
        else:
            for count in range({'One': 1, 'Two': 2, 'Three': 3}[result]):
                if count != 0:
                    self.dialog2.after(200)
                self.dialog2.bell()

    def _createOnTheFly(self):
        dialog = Pmw.MessageDialog(self.parent,
            title = 'On the fly dialog',
            defaultbutton = 0,
            buttons = ('OK', 'Apply', 'Cancel', 'Help'),
            message_text = 'This dialog was created when you clicked ' +
                'on the button.')
        dialog.iconname('Simple message dialog')
        result = dialog.activate()

        print 'You selected', result

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/NoteBook.html0000644000175000017500000003103110656147112017334 0ustar serge2serge2 Pmw.NoteBook reference manual

Pmw.NoteBook

Name

Pmw.NoteBook() - a set of tabbed pages

Inherits

Pmw.MegaArchetype

Description

A notebook contains a set of tabbed pages. At any one time only one of these pages (the selected page) is visible, with the other pages being hidden "beneath" it. Another page in the notebook may be displayed by clicking on the tab attached to the page. The tabs are displayed along the top edge.

Optionally, the notebook may be displayed without tabs. In this case, another selection widget, such as Pmw.OptionMenu, may be used to select the pages.

This megawidget is derived from Pmw.MegaArchetype (not Pmw.MegaWidget like most other megawidgets), with the hull class being Tkinter.Canvas.

Options

Options for this megawidget and its base classes are described below.

arrownavigation
Initialisation option. If true and a tab button has the keyboard focus, then the Left and Right arrow keys can be used to select the page before or after the tab button with the focus. The default is 1.

borderwidth
Initialisation option. The width of the border drawn around each tab and around the selected page. The default is 2.

createcommand
Specifies a function to call when a page is selected for the first time. The function is called with a single argument, which is the name of the selected page, and is called before the raisecommand function. This allows the creation of the page contents to be deferred until the page is first displayed. The default is None.

lowercommand
Specifies a function to call when the selected page is replaced with a new selected page. The function is called with a single argument, which is the name of the previously selected page, and is called before the createcommand or raisecommand functions. The default is None.

pagemargin
Initialisation option. The margin (in pixels) around the selected page inside the notebook's page border. The default is 4.

raisecommand
Specifies a function to call when a new page is selected. The function is called with a single argument, which is the name of the selected page. The default is None.

tabpos
Initialisation option. Specifies the location of the tabs. If 'n', tabs are created for each page and positioned at the top of the notebook. If None, no tabs are created, in which case another selection widget can be used to select pages by calling the selectpage() method. The default is 'n'.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the megawidget. The contents of the megawidget are created as canvas items and positioned in the hull using the canvas coordinate system. By default, this component is a Tkinter.Canvas.

Dynamic components

Page and tab components are created dynamically by the add() and insert() methods. By default, the pages are of type Tkinter.Frame and are created with a component group of Page and the tabs are of type Tkinter.Button and are created with a component group of Tab.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaArchetype. In addition, methods from the Tkinter.Canvas class are forwarded by this megawidget to the hull component.

add(pageName, **kw)
Add a page at the end of the notebook. See the insert() method for full details.

delete(*pageNames)
Delete the pages given by pageNames from the notebook. Each of the pageNames may have any of the forms accepted by the index() method.

If the currently selected page is deleted, then the next page, in index order, is selected. If the end page is deleted, then the previous page is selected.

getcurselection()
Return the name of the currently selected page.

index(index, forInsert = 0)
Return the numerical index of the page corresponding to index. This may be specified in any of the following forms:

name
Specifies the page labelled name.

number
Specifies the page numerically, where 0 corresponds to the first page.

Pmw.END
Specifies the last page.

Pmw.SELECT
Specifies the currently selected page.

If forInsert is true, Pmw.END returns the number of pages rather than the index of the last page.

insert(pageName, before = 0, **kw)
Add a page to the notebook as a component named pageName. The page is added just before the page specified by before, which may have any of the forms accepted by the index() method. If tabpos is not None, also create a tab as a component named pageName-tab. Keyword arguments prefixed with page_ or tab_ are passed to the respective constructors when creating the page or tab. If the tab_text keyword argument is not given, the text option of the tab defaults to pageName. If a page is inserted into an empty notebook, the page is selected. To add a page to the end of the notebook, use add(). The method returns the pageName component widget.

nextpage(pageIndex = None)
If pageIndex is None, then select the page after the currently selected page. Otherwise select the page after pageIndex, which may have any of the forms accepted by the index() method.

page(pageIndex)
Return the frame component widget of the page pageIndex, where pageIndex may have any of the forms accepted by the index() method.

pagenames()
Return a list of the names of the pages, in display order.

previouspage(pageIndex = None)
If pageIndex is None, then select the page before the currently selected page. Otherwise select the page before pageIndex, which may have any of the forms accepted by the index() method.

recolorborders()
Change the color of the page and tab borders. This method is required because the borders are created as canvas polygons and hence do not respond to normal color changing techniques, such as Pmw.Color.changecolor().

selectpage(page)
Select page to be the currently selected page. The page will be raised and the previous selected page will be lowered.

setnaturalsize(pageNames = None)
Set the width and height of the notebook to be the maximum requested width and height of the pages specified by pageNames. If pageNames is None, the size of all pages are used to determine the size of the notebook. Otherwise, pageNames must be a list of page names whose sizes are to be used to determine the size of the notebook. This method should be called after all pages and their contents have been created. It calls update_idletasks() so that the width and height of the pages can be determined. This may cause the notebook to flash onto the screen at the default size before resizing to the natural size.

tab(pageIndex)
Return the tab component widget of the page pageIndex, where pageIndex may have any of the forms accepted by the index() method. If tabpos is None, return None.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack the NoteBook.
        notebook = Pmw.NoteBook(parent)
        notebook.pack(fill = 'both', expand = 1, padx = 10, pady = 10)

        # Add the "Appearance" page to the notebook.
        page = notebook.add('Appearance')
        notebook.tab('Appearance').focus_set()

        # Create the "Toolbar" contents of the page.
        group = Pmw.Group(page, tag_text = 'Toolbar')
        group.pack(fill = 'both', expand = 1, padx = 10, pady = 10)
        b1 = Tkinter.Checkbutton(group.interior(), text = 'Show toolbar')
        b1.grid(row = 0, column = 0)
        b2 = Tkinter.Checkbutton(group.interior(), text = 'Toolbar tips')
        b2.grid(row = 0, column = 1)

        # Create the "Startup" contents of the page.
        group = Pmw.Group(page, tag_text = 'Startup')
        group.pack(fill = 'both', expand = 1, padx = 10, pady = 10)
        home = Pmw.EntryField(group.interior(), labelpos = 'w',
            label_text = 'Home page location:')
        home.pack(fill = 'x', padx = 20, pady = 10)

        # Add two more empty pages.
        page = notebook.add('Helpers')
        page = notebook.add('Images')

        notebook.setnaturalsize()

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 30 October 1999

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/OptionMenu.html0000644000175000017500000002424110656147112017716 0ustar serge2serge2 Pmw.OptionMenu reference manual

Pmw.OptionMenu

Name

Pmw.OptionMenu() - single item selection megawidget

Inherits

Pmw.MegaWidget

Description

An option menu consists of a menu button and an associated menu which pops up when the button is pressed. The text displayed in the menu button is updated whenever an item is selected in the menu. The currently selected value can be retrieved from the megawidget.

Options

Options for this megawidget and its base classes are described below.

command
Specifies a function to call whenever a menu item is selected or the invoke() method is called. The function is called with the currently selected value as its single argument. The default is None.

initialitem
Initialisation option. Specifies the initial selected value. This option is treated in the same way as the index argument of the setitems() method. The default is None.

items
Initialisation option. A sequence of strings containing the initial items to be displayed in the menu component. The default is ().

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

sticky
Initialisation option. The default is 'ew'.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

menu
The popup menu displayed when the menubutton is pressed. By default, this component is a Tkinter.Menu.

menubutton
The menu button displaying the currently selected value. By default, this component is a Tkinter.Menubutton.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

getcurselection()
Same as getvalue() method.

getvalue()
Return the currently selected value.

index(index)
Return the numerical index of the menu item corresponding to index. This may be specified in any of the following forms:

name
Specifies the menu item labelled name.

number
Specifies the menu item numerically, where 0 corresponds to the first menu item.

Pmw.END
Specifies the last menu item.

Pmw.SELECT
Specifies the currently selected menu item.

invoke(index = Pmw.SELECT)
Calling this method is the same as selecting the menu item specified by index: the text displayed by the menubutton component is updated and the function specified by the command option is called. index may have any of the forms accepted by the index() method. The value returned by command is returned.

setitems(items, index = None)
Replace all the items in the menu component with those specified by items, which must be a sequence of strings.

If index is not None, set the selected value to index, which may have any of the forms accepted by the index() method.

If index is None and the textvariable option of the menubutton component is the empty string, then if the previous selected value is one of the items, then do not change the selection. If the previous selected value is no longer in items, then set the selected value to the first value in items. If items is empty, set the selected value to the empty string.

If index is None and the textvariable option of the menubutton component is not the empty string, then do not set the selected value. This assumes that the variable is already (or will be) set to the desired value.

setvalue(text)
Set the text displayed by the menubutton component to text.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack the OptionMenu megawidgets.
        # The first one has a textvariable.
        self.var = Tkinter.StringVar()
        self.var.set('steamed')
        self.method_menu = Pmw.OptionMenu(parent,
                labelpos = 'w',
                label_text = 'Choose method:',
                menubutton_textvariable = self.var,
                items = ['baked', 'steamed', 'stir fried', 'boiled', 'raw'],
                menubutton_width = 10,
        )
        self.method_menu.pack(anchor = 'w', padx = 10, pady = 10)

        self.vege_menu = Pmw.OptionMenu (parent,
                labelpos = 'w',
                label_text = 'Choose vegetable:',
                items = ('broccoli', 'peas', 'carrots', 'pumpkin'),
                menubutton_width = 10,
                command = self._printOrder,
        )
        self.vege_menu.pack(anchor = 'w', padx = 10, pady = 10)

        self.direction_menu = Pmw.OptionMenu (parent,
                labelpos = 'w',
                label_text = 'Menu direction:',
                items = ('flush', 'above', 'below', 'left', 'right'),
                menubutton_width = 10,
                command = self._changeDirection,
        )
        self.direction_menu.pack(anchor = 'w', padx = 10, pady = 10)

        menus = (self.method_menu, self.vege_menu, self.direction_menu)
        Pmw.alignlabels(menus)

    def _printOrder(self, vege):
        # Can use 'self.var.get()' instead of 'getcurselection()'.
        print 'You have chosen %s %s.' % \
            (self.method_menu.getcurselection(), vege)

    def _changeDirection(self, direction):
        for menu in (self.method_menu, self.vege_menu, self.direction_menu):
            menu.configure(menubutton_direction = direction)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 23 October 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/PanedWidget.html0000644000175000017500000003062710656147112020021 0ustar serge2serge2 Pmw.PanedWidget reference manual

Pmw.PanedWidget

Name

Pmw.PanedWidget() - frame subdivided into several resizable panes

Inherits

Pmw.MegaWidget

Description

A paned widget is a container megawidget which manages a number of resizable frames, known as panes. Each pane may act as the container for other widgets. The user may interactively resize the panes by dragging a small rectangle (the handle) or the line between the panes (the separator). The panes may be arranged horizontally or vertically. Each pane may have maximum and minimum limits of its size.

Options

Options for this megawidget and its base classes are described below.

command
Specifies a function to be called whenever the size of any of the panes changes. The function is called with a single argument, being a list of the sizes of the panes, in order. For vertical orientation, the size is the height of the panes. For horizontal orientation, the size is the width of the panes. The default is None.

handlesize
Initialisation option. Specifies the size in pixels of the square handle which appears on the lines separating the panes. The default is 8.

orient
Initialisation option. Specifies the orientation of the paned widget. This may be 'horizontal' or 'vertical'. If 'vertical', the panes are stacked above and below each other, otherwise the panes are laid out side by side. The default is 'vertical'.

separatorrelief
Initialisation option. Specifies the relief of the lines separating the panes. The default is 'sunken'.

separatorthickness
Initialisation option. Specifies the thickness of the lines separating the panes. The default is 2.

Pane options

Each pane has the following options. These may be set when creating or configuring a pane. The value of each option may be an integer, which specifies a pane size in pixels, or a real number between 0.0 and 1.0, which specifies a pane size proportional to the size of the entire paned widget.

size
Specifies the initial size of the pane. The default is 0.

min
Specifies the minimum size of the pane. The default is 0.

max
Specifies the maximum size of the pane. The default is a very large number.

Components

Components created by this megawidget and its base classes are described below.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

Dynamic components

Frame, separator and handle components are created dynamically by the add() and insert() methods. The components are of type Tkinter.Frame and are created with component groups of Frame, Separator and Handle respectively.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

add(name, **kw)
Add a pane to the end of the paned widget as a component named name. This is equivalent to calling insert() with before set to the current number of panes. The method returns the name component widget.

configurepane(name, **kw)
Configure the pane specified by name, where name is either an integer, specifying the index of the pane, or a string, specifying the name of the pane. The keyword arguments specify the new values for the options for the pane. These options are described in the Pane options section.

delete(name)
Delete the pane specified by name, where name is either an integer, specifying the index of the pane, or a string, specifying the name of the pane.

If the pane deleted was not the only pane in the paned widget, also delete the separator and handle components named separator-n and handle-n, where n is the number of panes remaining.

insert(name, before = 0, **kw)
Add a pane to the paned widget as a component named name. The pane is added just before the pane specified by before, where before may be either an integer, specifying the index of the pane, or a string, specifying the name of the pane. The keyword arguments specify the initial values for the options for the new pane. These options are described in the Pane options section. To add a pane to the end of the paned widget, use add().

The new pane is created as a Tkinter.Frame component named name. If this is not the only pane, a separator and handle are also created as components named separator-n and handle-n, where n is one less than the number of panes. The method returns the name component widget.

move(name, newPos, newPosOffset = 0)
Move the pane specified by name to the new position specified by newPos. The first two arguments may be either an integer, specifying the index of the pane, or a string, specifying the name of the pane. If newPosOffset is specified, it is added to the newPos index. For example, to move a horizontal pane one pane to the left, specify the name or index of the pane for both name and newPos and specify -1 for newPosOffset.

pane(name)
Return the Tkinter.Frame pane widget for the pane specified by name, where name is either an integer, specifying the index of the pane, or a string, specifying the name of the pane.

panes()
Return a list of the names of the panes, in display order.

setnaturalsize()
If oriented horizontally, set the width of the paned widget to the sum of the requested widths of all panes and set the height to the maximum requested height of all panes.

If oriented vertically, set the height of the paned widget to the sum of the requested heights of all panes and set the width to the maximum requested width of all panes.

updatelayout()
Recalculate size and position of panes. This method must be called after adding or deleting one or more panes. However it does not need to be called when panes are first added to a newly created paned widget, before it has been displayed.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):

        # Create a main PanedWidget with a few panes.
        self.pw = Pmw.PanedWidget(parent,
                orient='vertical',
                hull_borderwidth = 1,
                hull_relief = 'sunken',
                hull_width=300,
                hull_height=400)
        for self.numPanes in range(4):
            if self.numPanes == 1:
                name = 'Fixed size'
                pane = self.pw.add(name, min = .1, max = .1)
            else:
                name = 'Pane ' + str(self.numPanes)
                pane = self.pw.add(name, min = .1, size = .25)
            label = Tkinter.Label(pane, text = name)
            label.pack(side = 'left', expand = 1)
            button = Tkinter.Button(pane, text = 'Delete',
                    command = lambda s=self, n=name: s.deletePane(n))
            button.pack(side = 'left', expand = 1)
            # TODO: add buttons to invoke self.moveOneUp and self.moveOneUp.

        self.pw.pack(expand = 1, fill='both')

        buttonBox = Pmw.ButtonBox(parent)
        buttonBox.pack(fill = 'x')
        buttonBox.add('Add pane', command = self.addPane)   
        buttonBox.add('Move pane', command = self.move)   
        self.moveSrc = 0
        self.moveNewPos = 1
        self.moveBack = 0

    def move(self):
        numPanes = len(self.pw.panes())
        if numPanes == 0:
            print 'No panes to move!'
            return

        if self.moveSrc >= numPanes:
            self.moveSrc = numPanes - 1
        if self.moveNewPos >= numPanes:
            self.moveNewPos = numPanes - 1
        print 'Moving pane', self.moveSrc, 'to new position', self.moveNewPos
        self.pw.move(self.moveSrc, self.moveNewPos)

        self.moveSrc, self.moveNewPos = self.moveNewPos, self.moveSrc
        if self.moveBack:
            if self.moveNewPos == numPanes - 1:
                self.moveNewPos = 0
                if self.moveSrc == numPanes - 1:
                    self.moveSrc = 0
                else:
                    self.moveSrc = self.moveSrc + 1
            else:
                self.moveNewPos = self.moveNewPos + 1
        self.moveBack = not self.moveBack

    def addPane(self):
        self.numPanes = self.numPanes + 1
        name = 'Pane ' + str(self.numPanes)
        print 'Adding', name
        pane = self.pw.add(name, min = .1, size = .25)
        label = Tkinter.Label(pane, text = name)
        label.pack(side = 'left', expand = 1)
        button = Tkinter.Button(pane, text = 'Delete',
                command = lambda s=self, n=name: s.deletePane(n))
        button.pack(side = 'left', expand = 1)
        self.pw.updatelayout()

    def deletePane(self, name):
        print 'Deleting', name
        self.pw.delete(name)
        self.pw.updatelayout()

    def moveOneUp(self, name):
        self.pw.move(name, name, -1)

    def moveOneDown(self, name):
        self.pw.move(name, name, 1)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 14 April 2001

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/PromptDialog.html0000644000175000017500000002304110656147112020217 0ustar serge2serge2 Pmw.PromptDialog reference manual

Pmw.PromptDialog

Name

Pmw.PromptDialog() - selection dialog displaying an entry field

Inherits

Pmw.Dialog

Description

The prompt dialog is a dialog window which displays an entry field which can be used to prompt the user for a value.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

borderx
Initialisation option. The padding to the left and right of the entry field. The default is 20.

bordery
Initialisation option. The padding above and below the entry field. The default is 20.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('OK',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

entryfield
The entry field for the user to enter a value. By default, this component is a Pmw.EntryField.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

entry
Alias for entryfield_entry.
label
Alias for entryfield_label.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.Dialog. In addition, methods from the Pmw.EntryField class are forwarded by this megawidget to the entryfield component.

deleteentry(first, last = None)
Delete text from the entry field's entry widget. An alias for component('entry').delete().

indexentry(index)
An alias for component('entry').index().

insertentry(index, text)
Insert text into the entry field's entry widget. An alias for component('entry').insert().

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the dialog to prompt for the password.
        self.dialog = Pmw.PromptDialog(parent,
            title = 'Password',
            label_text = 'Password:',
            entryfield_labelpos = 'n',
            entry_show = '*',
            defaultbutton = 0,
            buttons = ('OK', 'Cancel'),
            command = self.execute)
        self.dialog.withdraw()

        # Create the confirmation dialog.
        self.confirm = Pmw.MessageDialog(
            title = 'Are you sure?',
            message_text = 'Are you really sure?',
            defaultbutton = 0,
            buttons = ('OK', 'Cancel'))
        self.confirm.withdraw()

        # Create button to launch the dialog.
        w = Tkinter.Button(parent, text = 'Show prompt dialog',
                command = self.dialog.activate)
        w.pack(padx = 8, pady = 8)

    def execute(self, result):
        if result is None or result == 'Cancel':
            print 'Password prompt cancelled'
            self.dialog.deactivate(result)
        else:
            result = self.confirm.activate()
            if result == 'OK':
                print 'Password entered ' + self.dialog.get()
                self.dialog.deactivate()

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/RadioSelect.html0000644000175000017500000003522510656147112020023 0ustar serge2serge2 Pmw.RadioSelect reference manual

Pmw.RadioSelect

Name

Pmw.RadioSelect() - a set of buttons, some of which may be selected

Inherits

Pmw.MegaWidget

Description

A radio select is a container megawidget which manages a number of buttons. The buttons may be laid out either horizontally or vertically. In single selection mode, only one button may be selected at any one time. In multiple selection mode, several buttons may be selected at the same time and clicking on a selected button will deselect it.

The buttons displayed can be either standard buttons, radio buttons or check buttons. When selected, standard buttons are displayed sunken and radio and check buttons are displayed with the appropriate indicator color and relief.

Options

Options for this megawidget and its base classes are described below.

buttontype
Initialisation option. Specifies the default type of buttons created by the add() method. If 'button', the default type is Tkinter.Button. If 'radiobutton', the default type is Tkinter.Radiobutton. If 'checkbutton', the default type is Tkinter.Checkbutton.

If 'radiobutton', single selection mode is automatically set. If 'checkbutton', multiple selection mode is automatically set. The default is 'button'.

command
Specifies a function to call when one of the buttons is clicked on or when invoke() is called.

In single selection mode, the function is called with a single argument, which is the name of the selected button.

In multiple selection mode, the function is called with the first argument being the name of the button and the second argument being true if the button is now selected or false if it is now deselected. The default is None.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

orient
Initialisation option. Specifies the direction in which the buttons are laid out. This may be 'horizontal' or 'vertical'. The default is 'horizontal'.

padx
Initialisation option. Specifies a padding distance to leave between each button in the x direction and also between the buttons and the outer edge of the radio select. The default is 5.

pady
Initialisation option. Specifies a padding distance to leave between each button in the y direction and also between the buttons and the outer edge of the radio select. The default is 5.

selectmode
Initialisation option. Specifies the selection mode: whether a single button or multiple buttons can be selected at one time. If 'single', clicking on an unselected button selects it and deselects all other buttons. If 'multiple', clicking on an unselected button selects it and clicking on a selected button deselects it. This option is ignored if buttontype is 'radiobutton' or 'checkbutton'. The default is 'single'.

Components

Components created by this megawidget and its base classes are described below.

frame
If the label component has been created (that is, the labelpos option is not None), the frame component is created to act as the container of the buttons created by the add() method. If there is no label component, then no frame component is created and the hull component acts as the container. By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

Dynamic components

Button components are created dynamically by the add() method. The default type of the buttons depends on the value of the buttontype option.

Button components are created with a component group of Button.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

add(componentName, **kw)
Add a button to the end of the radio select as a component named componentName. with a default type as specified by buttontype. Any keyword arguments present (except command) will be passed to the constructor when creating the button. If the text keyword argument is not given, the text option of the button defaults to componentName. The method returns the component widget.

button(buttonIndex)
Return the button specified by buttonIndex, which may have any of the forms accepted by the index() method.

deleteall()
Delete all buttons and clear the current selection.

getcurselection()
Same as getvalue() method.

getvalue()
In single selection mode, return the name of the currently selected button, or None if no buttons have been selected yet.

In multiple selection mode, return a list of the names of the currently selected buttons.

index(index)
Return the numerical index of the button corresponding to index. This may be specified in any of the following forms:

name
Specifies the button named name.

number
Specifies the button numerically, where 0 corresponds to the left (or top) button.

Pmw.END
Specifies the right (or bottom) button.

invoke(index)
Calling this method is the same as clicking on the button specified by index: the buttons are displayed selected or deselected according to the selection mode and command is called. index may have any of the forms accepted by the index() method. The value returned by command is returned.

numbuttons()
Return the number of buttons in the radio select.

setvalue(textOrList)
Set the current selection for the radio select to textOrList, but do not invoke command.

In single selection mode, select only the button specified by the string textOrList.

In multiple selection mode, select only the buttons specified by the list textOrList.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack a horizontal RadioSelect widget.
        horiz = Pmw.RadioSelect(parent,
                labelpos = 'w',
                command = self.callback,
                label_text = 'Horizontal',
                frame_borderwidth = 2,
                frame_relief = 'ridge'
        )
        horiz.pack(fill = 'x', padx = 10, pady = 10)

        # Add some buttons to the horizontal RadioSelect.
        for text in ('Fruit', 'Vegetables', 'Cereals', 'Legumes'):
            horiz.add(text)
        horiz.invoke('Cereals')

        # Create and pack a multiple selection RadioSelect widget.
        self.multiple = Pmw.RadioSelect(parent,
                labelpos = 'w',
                command = self.multcallback,
                label_text = 'Multiple\nselection',
                frame_borderwidth = 2,
                frame_relief = 'ridge',
                selectmode = 'multiple',
        )
        self.multiple.pack(fill = 'x', padx = 10)

        # Add some buttons to the multiple selection RadioSelect.
        for text in ('Apricots', 'Eggplant', 'Rice', 'Lentils'):
            self.multiple.add(text)
        self.multiple.invoke('Rice')

        # Create and pack a vertical RadioSelect widget, with checkbuttons.
        self.checkbuttons = Pmw.RadioSelect(parent,
                buttontype = 'checkbutton',
                orient = 'vertical',
                labelpos = 'w',
                command = self.checkbuttoncallback,
                label_text = 'Vertical,\nusing\ncheckbuttons',
                hull_borderwidth = 2,
                hull_relief = 'ridge',
        )
        self.checkbuttons.pack(side = 'left', expand = 1, padx = 10, pady = 10)

        # Add some buttons to the checkbutton RadioSelect.
        for text in ('Male', 'Female'):
            self.checkbuttons.add(text)
        self.checkbuttons.invoke('Male')
        self.checkbuttons.invoke('Female')

        # Create and pack a RadioSelect widget, with radiobuttons.
        radiobuttons = Pmw.RadioSelect(parent,
                buttontype = 'radiobutton',
                orient = 'vertical',
                labelpos = 'w',
                command = self.callback,
                label_text = 'Vertical,\nusing\nradiobuttons',
                hull_borderwidth = 2,
                hull_relief = 'ridge',
        )
        radiobuttons.pack(side = 'left', expand = 1, padx = 10, pady = 10)

        # Add some buttons to the radiobutton RadioSelect.
        for text in ('Male', 'Female', 'Both', 'Neither'):
            radiobuttons.add(text)
        radiobuttons.invoke('Both')

    def callback(self, tag):
        # This is called whenever the user clicks on a button
        # in a single select RadioSelect widget.
        print 'Button', tag, 'was pressed.'

    def multcallback(self, tag, state):
        # This is called whenever the user clicks on a button
        # in the multiple select RadioSelect widget.
        if state:
           action = 'pressed.'
        else:
           action = 'released.'

        print 'Button', tag, 'was', action, \
                'Selection:', self.multiple.getcurselection()
           
    def checkbuttoncallback(self, tag, state):
        # This is called whenever the user clicks on a button
        # in the checkbutton RadioSelect widget.
        if state:
           action = 'pressed.'
        else:
           action = 'released.'

        print 'Button', tag, 'was', action, \
                'Selection:', self.checkbuttons.getcurselection()
           

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 6 June 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ScrolledCanvas.html0000644000175000017500000003052410656147112020525 0ustar serge2serge2 Pmw.ScrolledCanvas reference manual

Pmw.ScrolledCanvas

Name

Pmw.ScrolledCanvas() - canvas with optional scrollbars

Inherits

Pmw.MegaWidget

Description

A scrolled canvas consists of a standard canvas widget with optional scrollbars which can be used to scroll the canvas. The scrollbars can be dynamic, which means that a scrollbar will only be displayed if it is necessary, that is, if the scrollregion of the canvas is larger than the canvas.

Options

Options for this megawidget and its base classes are described below.

borderframe
Initialisation option. If true, the borderframe component will be created. The default is 0.

canvasmargin
Initialisation option. The margin around the items in the canvas. Used by the resizescrollregion() method. The default is 0.

hscrollmode
The horizontal scroll mode. If 'none', the horizontal scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

scrollmargin
Initialisation option. The distance between the scrollbars and the enclosing canvas widget. The default is 2.

usehullsize
Initialisation option. If true, the size of the megawidget is determined solely by the width and height options of the hull component.

Otherwise, the size of the megawidget is determined by the width and height of the canvas component, along with the size and/or existence of the other components, such as the label, the scrollbars and the scrollmargin option. All these affect the overall size of the megawidget. The default is 0.

vscrollmode
The vertical scroll mode. If 'none', the vertical scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

Components

Components created by this megawidget and its base classes are described below.

borderframe
A frame widget which snuggly fits around the canvas, to give the appearance of a canvas border. It is created with a border so that the canvas, which is created without a border, looks like it has a border. By default, this component is a Tkinter.Frame.

canvas
The canvas widget which is scrolled by the scrollbars. If the borderframe option is true, this is created with a borderwidth of 0 to overcome a known problem with canvas widgets: if a widget inside a canvas extends across one of the edges of the canvas, then the widget obscures the border of the canvas. Therefore, if the canvas has no border, then this overlapping does not occur. By default, this component is a Tkinter.Canvas.

horizscrollbar
The horizontal scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

vertscrollbar
The vertical scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the Tkinter.Canvas class are forwarded by this megawidget to the canvas component.

bbox(*args)
This method is explicitly forwarded to the canvas component's bbox() method. Without this explicit forwarding, the bbox() method (aliased to grid_bbox()) of the hull would be invoked, which is probably not what the programmer intended.

interior()
Return the canvas widget within which the programmer should create graphical items and child widgets. This is the same as component('canvas').

resizescrollregion()
Resize the scrollregion of the canvas component to be the bounding box covering all the items in the canvas plus a margin on all sides, as specified by the canvasmargin option.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the ScrolledCanvas.
        self.sc = Pmw.ScrolledCanvas(parent,
                borderframe = 1,
                labelpos = 'n',
                label_text = 'ScrolledCanvas',
                usehullsize = 1,
                hull_width = 400,
                hull_height = 300,
        )

        # Create a group widget to contain the scrollmode options.
        w = Pmw.Group(parent, tag_text='Scroll mode')
        w.pack(side = 'bottom', padx = 5, pady = 5)

        hmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Horizontal:',
                items = ['none', 'static', 'dynamic'],
                command = self.sethscrollmode,
                menubutton_width = 8,
        )
        hmode.pack(side = 'left', padx = 5, pady = 5)
        hmode.invoke('dynamic')

        vmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Vertical:',
                items = ['none', 'static', 'dynamic'],
                command = self.setvscrollmode,
                menubutton_width = 8,
        )
        vmode.pack(side = 'left', padx = 5, pady = 5)
        vmode.invoke('dynamic')

        buttonBox = Pmw.ButtonBox(parent)
        buttonBox.pack(side = 'bottom')
        buttonBox.add('yview', text = 'Show\nyview', command = self.showYView)
        buttonBox.add('scroll', text = 'Page\ndown', command = self.pageDown)
        buttonBox.add('center', text = 'Center', command = self.centerPage)

        # Pack this last so that the buttons do not get shrunk when
        # the window is resized.
        self.sc.pack(padx = 5, pady = 5, fill = 'both', expand = 1)

        self.sc.component('canvas').bind('<1>', self.addcircle)

        testEntry = Tkinter.Entry(parent)
        self.sc.create_line(20, 20, 100, 100)
        self.sc.create_oval(100, 100, 200, 200, fill = 'green')
        self.sc.create_text(100, 20, anchor = 'nw',
                text = 'Click in the canvas\nto draw ovals',
                font = testEntry.cget('font'))
        button = Tkinter.Button(self.sc.interior(),
                text = 'Hello,\nWorld!\nThis\nis\na\nbutton.')
        self.sc.create_window(200, 200,
                anchor='nw',
                window = button)

        # Set the scroll region of the canvas to include all the items
        # just created.
        self.sc.resizescrollregion()

        self.colours = ('red', 'green', 'blue', 'yellow', 'cyan', 'magenta',
                'black', 'white')
        self.oval_count = 0
        self.rand = 12345

    def sethscrollmode(self, tag):
        self.sc.configure(hscrollmode = tag)

    def setvscrollmode(self, tag):
        self.sc.configure(vscrollmode = tag)

    def addcircle(self, event):
        x = self.sc.canvasx(event.x)
        y = self.sc.canvasy(event.y)
        width = 10 + self.random() % 100
        height = 10 + self.random() % 100
        self.sc.create_oval(
            x - width, y - height, x + width, y + height,
            fill = self.colours[self.oval_count])
        self.oval_count = (self.oval_count + 1) % len(self.colours)
        self.sc.resizescrollregion()

    # Simple random number generator.
    def random(self):
        self.rand = (self.rand * 125) % 2796203
        return self.rand

    def showYView(self):
        print self.sc.yview()

    def pageDown(self):
        self.sc.yview('scroll', 1, 'page')

    def centerPage(self):
        top, bottom = self.sc.yview()
        size = bottom - top
        middle = 0.5 - size / 2
        self.sc.yview('moveto', middle)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 20 September 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ScrolledField.html0000644000175000017500000001450010656147112020331 0ustar serge2serge2 Pmw.ScrolledField reference manual

Pmw.ScrolledField

Name

Pmw.ScrolledField() - single line scrollable output field

Inherits

Pmw.MegaWidget

Description

A scrolled field displays a single line of text. If the text is too wide to display in the megawidget it can be scrolled to the left and right by the user by dragging with the middle mouse button. The text is also selectable by clicking or dragging with the left mouse button.

It can be used instead of a Tkinter.Label widget when displaying text of unknown width such as application status messages.

Options

Options for this megawidget and its base classes are described below.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

sticky
Initialisation option. The default is 'ew'.

text
Specifies the text to display in the scrolled field. The default is ''.

Components

Components created by this megawidget and its base classes are described below.

entry
This is used to display the text and allows the user to scroll and select the text. The state of this component is set to 'readonly' (or 'disabled' in earlier versions of Tcl/Tk which do not support 'readonly'), so that the user is unable to modify the text. By default, this component is a Tkinter.Entry.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

Methods

This megawidget has no methods of its own. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the Tkinter.Entry class are forwarded by this megawidget to the entry component.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create and pack the ScrolledField.
        self._field = Pmw.ScrolledField(parent, entry_width = 30,
                entry_relief='groove', labelpos = 'n',
                label_text = 'Scroll the field using the\nmiddle mouse button')
        self._field.pack(fill = 'x', expand = 1, padx = 10, pady = 10)

        # Create and pack a button to change the ScrolledField.
        self._button = Tkinter.Button(parent, text = 'Change field',
                command = self.execute)
        self._button.pack(padx = 10, pady = 10)

        self._index = 0
        self.execute()

    def execute(self):
        self._field.configure(text = lines[self._index % len(lines)])
        self._index = self._index + 1

lines = (
  'Alice was beginning to get very tired of sitting by her sister',
  'on the bank, and of having nothing to do:  once or twice she had',
  'peeped into the book her sister was reading, but it had no',
  'pictures or conversations in it, "and what is the use of a book,"',
  'thought Alice "without pictures or conversation?"',
  'Alice\'s Adventures in Wonderland',
  'Lewis Carroll',
)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 23 August 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ScrolledFrame.html0000644000175000017500000004464710656147112020357 0ustar serge2serge2 Pmw.ScrolledFrame reference manual

Pmw.ScrolledFrame

Name

Pmw.ScrolledFrame() - frame with optional scrollbars

Inherits

Pmw.MegaWidget

Description

A scrolled frame consists of a scrollable interior frame within a clipping frame. The programmer can create other widgets within the interior frame. If the frame becomes larger than the surrounding clipping frame, the user can position the frame using the horizontal and vertical scrollbars.

The scrollbars can be dynamic, which means that a scrollbar will only be displayed if it is necessary. That is, if the frame is smaller than the surrounding clipping frame, the scrollbar will be hidden.

Options

Options for this megawidget and its base classes are described below.

borderframe
Initialisation option. If true, the borderframe component will be created. The default is 1.

horizflex
Specifies how the width of the scrollable interior frame should be resized relative to the clipping frame.

If 'fixed', the interior frame is set to the natural width, as requested by the child widgets of the frame. If 'expand' and the requested width of the interior frame is less than the width of the clipping frame, the interior frame expands to fill the clipping frame. If 'shrink' and the requested width of the interior frame is more than the width of the clipping frame, the interior frame shrinks to the width of the clipping frame. If 'elastic', the width of the interior frame is always set to the width of the clipping frame. The default is 'fixed'.

horizfraction
Initialisation option. The fraction of the width of the clipper frame to scroll the interior frame when the user clicks on the horizontal scrollbar arrows. The default is 0.05.

hscrollmode
The horizontal scroll mode. If 'none', the horizontal scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

scrollmargin
Initialisation option. The distance between the scrollbars and the clipping frame. The default is 2.

usehullsize
Initialisation option. If true, the size of the megawidget is determined solely by the width and height options of the hull component.

Otherwise, the size of the megawidget is determined by the width and height of the clipper component, along with the size and/or existence of the other components, such as the label, the scrollbars and the scrollmargin option. All these affect the overall size of the megawidget. The default is 0.

vertflex
Specifies how the height of the scrollable interior frame should be resized relative to the clipping frame.

If 'fixed', the interior frame is set to the natural height, as requested by the child widgets of the frame. If 'expand' and the requested height of the interior frame is less than the height of the clipping frame, the interior frame expands to fill the clipping frame. If 'shrink' and the requested height of the interior frame is more than the height of the clipping frame, the interior frame shrinks to the height of the clipping frame. If 'elastic', the height of the interior frame is always set to the height of the clipping frame. The default is 'fixed'.

vertfraction
Initialisation option. The fraction of the height of the clipper frame to scroll the interior frame when the user clicks on the vertical scrollbar arrows. The default is 0.05.

vscrollmode
The vertical scroll mode. If 'none', the vertical scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

Components

Components created by this megawidget and its base classes are described below.

borderframe
A frame widget which snuggly fits around the clipper, to give the appearance of a border. It is created with a border so that the clipper, which is created without a border, looks like it has a border. By default, this component is a Tkinter.Frame.

clipper
The frame which is used to provide a clipped view of the frame component. If the borderframe option is true, this is created with a borderwidth of 0 to overcome a known problem with using place to position widgets: if a widget (in this case the frame component) is placed inside a frame (in this case the clipper component) and it extends across one of the edges of the frame, then the widget obscures the border of the frame. Therefore, if the clipper has no border, then this overlapping does not occur. By default, this component is a Tkinter.Frame.

frame
The frame within the clipper to contain the widgets to be scrolled. By default, this component is a Tkinter.Frame.

horizscrollbar
The horizontal scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

vertscrollbar
The vertical scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

interior()
Return the frame within which the programmer may create widgets to be scrolled. This is the same as component('frame').

reposition()
Update the position of the frame component in the clipper and update the scrollbars.

Usually, this method does not need to be called explicitly, since the position of the frame component and the scrollbars are automatically updated whenever the size of the frame or clipper components change or the user clicks in the scrollbars. However, if horizflex or vertflex is 'expand', the megawidget cannot detect when the requested size of the frame increases to greater than the size of the clipper. Therefore, this method should be called when a new widget is added to the frame (or a widget is increased in size) after the initial megawidget construction.

xview(mode = None, value = None, units = None)
Query or change the horizontal position of the scrollable interior frame. If mode is None, return a tuple of two numbers, each between 0.0 and 1.0. The first is the position of the left edge of the visible region of the contents of the scrolled frame, expressed as a fraction of the total width of the contents. The second is the position of the right edge of the visible region.

If mode == 'moveto', adjust the view of the interior so that the fraction value of the total width of the contents is off-screen to the left. The value must be between 0.0 and 1.0.

If mode == 'scroll', adjust the view of the interior left or right by a fixed amount. If what is 'units', move the view in units of horizfraction. If what is pages, move the view in units of the width of the scrolled frame. If value is positive, move to the right, otherwise move to the left.

yview(mode = None, value = None, units = None)
Query or change the vertical position of the scrollable interior frame. If mode is None, return a tuple of two numbers, each between 0.0 and 1.0. The first is the position of the top edge of the visible region of the contents of the scrolled frame, expressed as a fraction of the total height of the contents. The second is the position of the bottom edge of the visible region.

If mode == 'moveto', adjust the view of the interior so that the fraction value of the total height of the contents is off-screen to the top. The value must be between 0.0 and 1.0.

If mode == 'scroll', adjust the view of the interior up or down by a fixed amount. If what is 'units', move the view in units of vertfraction. If what is pages, move the view in units of the height of the scrolled frame. If value is positive, move to down, otherwise move up.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the ScrolledFrame.
        self.sf = Pmw.ScrolledFrame(parent,
                labelpos = 'n', label_text = 'ScrolledFrame',
                usehullsize = 1,
                hull_width = 400,
                hull_height = 220,
        )

        # Create a group widget to contain the flex options.
        w = Pmw.Group(parent, tag_text='Flex')
        w.pack(side = 'bottom', padx = 5, pady = 3)

        hflex = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Horizontal:',
                items = ['fixed', 'expand', 'shrink', 'elastic'],
                command = self.sethflex,
                menubutton_width = 8,
        )
        hflex.pack(side = 'left', padx = 5, pady = 3)
        hflex.invoke('fixed')

        vflex = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Vertical:',
                items = ['fixed', 'expand', 'shrink', 'elastic'],
                command = self.setvflex,
                menubutton_width = 8,
        )
        vflex.pack(side = 'left', padx = 5, pady = 3)
        vflex.invoke('fixed')

        # Create a group widget to contain the scrollmode options.
        w = Pmw.Group(parent, tag_text='Scroll mode')
        w.pack(side = 'bottom', padx = 5, pady = 0)

        hmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Horizontal:',
                items = ['none', 'static', 'dynamic'],
                command = self.sethscrollmode,
                menubutton_width = 8,
        )
        hmode.pack(side = 'left', padx = 5, pady = 3)
        hmode.invoke('dynamic')

        vmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Vertical:',
                items = ['none', 'static', 'dynamic'],
                command = self.setvscrollmode,
                menubutton_width = 8,
        )
        vmode.pack(side = 'left', padx = 5, pady = 3)
        vmode.invoke('dynamic')

        self.radio = Pmw.RadioSelect(parent, selectmode = 'multiple',
            command = self.radioSelected)
        self.radio.add('center', text = 'Keep centered vertically')
        self.radio.pack(side = 'bottom')

        buttonBox = Pmw.ButtonBox(parent)
        buttonBox.pack(side = 'bottom')
        buttonBox.add('add', text = 'Add a button', command = self.addButton)
        buttonBox.add('yview', text = 'Show yview', command = self.showYView)
        buttonBox.add('scroll', text = 'Page down', command = self.pageDown)

        # Pack this last so that the buttons do not get shrunk when
        # the window is resized.
        self.sf.pack(padx = 5, pady = 3, fill = 'both', expand = 1)

        self.frame = self.sf.interior()

        self.row = 0
        self.col = 0

        for count in range(15):
            self.addButton()

    def sethscrollmode(self, tag):
        self.sf.configure(hscrollmode = tag)

    def setvscrollmode(self, tag):
        self.sf.configure(vscrollmode = tag)

    def sethflex(self, tag):
        self.sf.configure(horizflex = tag)

    def setvflex(self, tag):
        self.sf.configure(vertflex = tag)

    def addButton(self):
        button = Tkinter.Button(self.frame,
            text = '(%d,%d)' % (self.col, self.row))
        button.grid(row = self.row, column = self.col, sticky = 'nsew')

        self.frame.grid_rowconfigure(self.row, weight = 1)
        self.frame.grid_columnconfigure(self.col, weight = 1)
        if self.sf.cget('horizflex') == 'expand' or \
                self.sf.cget('vertflex') == 'expand':
            self.sf.reposition()

        if 'center' in self.radio.getcurselection():
            self.sf.update_idletasks()
            self.centerPage()

        if self.col == self.row:
            self.col = 0
            self.row = self.row + 1
        else:
            self.col = self.col + 1

    def showYView(self):
        print self.sf.yview()

    def pageDown(self):
        self.sf.yview('scroll', 1, 'page')

    def radioSelected(self, name, state):
        if state:
            self.centerPage()

    def centerPage(self):
        # Example of how to use the yview() method of Pmw.ScrolledFrame.
        top, bottom = self.sf.yview()
        size = bottom - top
        middle = 0.5 - size / 2
        self.sf.yview('moveto', middle)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 February 2001

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ScrolledListBox.html0000644000175000017500000003240410656147112020675 0ustar serge2serge2 Pmw.ScrolledListBox reference manual

Pmw.ScrolledListBox

Name

Pmw.ScrolledListBox() - listbox with optional scrollbars

Inherits

Pmw.MegaWidget

Description

A scrolled listbox consists of a standard listbox widget with optional scrollbars which can be used to scroll the listbox. The scrollbars can be dynamic, which means that a scrollbar will only be displayed if it is necessary. That is, if the listbox does not contain enough entries, the vertical scrollbar will be automatically hidden and if the entries are not wide enough, the horizontal scrollbar will be automatically hidden.

Options

Options for this megawidget and its base classes are described below.

dblclickcommand
This specifies a function to call when mouse button 1 is double clicked over an entry in the listbox component. The default is None.

hscrollmode
The horizontal scroll mode. If 'none', the horizontal scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

items
Initialisation option. A tuple containing the initial items to be displayed by the listbox component. The default is ().

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

scrollmargin
Initialisation option. The distance between the scrollbars and the listbox widget. The default is 2.

selectioncommand
This specifies a function to call when mouse button 1 is single clicked over an entry in the listbox component or if the <Space> or <Return> key is hit while the listbox has focus. The default is None.

usehullsize
Initialisation option. If true, the size of the megawidget is determined solely by the width and height options of the hull component.

Otherwise, the size of the megawidget is determined by the width and height of the listbox component, along with the size and/or existence of the other components, such as the label, the scrollbars and the scrollmargin option. All these affect the overall size of the megawidget. The default is 0.

vscrollmode
The vertical scroll mode. If 'none', the vertical scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

Components

Components created by this megawidget and its base classes are described below.

horizscrollbar
The horizontal scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

listbox
The listbox widget which is scrolled by the scrollbars. By default, this component is a Tkinter.Listbox.

vertscrollbar
The vertical scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the Tkinter.Listbox class are forwarded by this megawidget to the listbox component.

bbox(index)
This method is explicitly forwarded to the listbox component's bbox() method. Without this explicit forwarding, the bbox() method (aliased to grid_bbox()) of the hull would be invoked, which is probably not what the programmer intended.

clear()
Delete all items from the scrolled listbox. Equivalent to setlist(()).

get(first = None, last = None)
This is the same as the get() method of the listbox component, except that if first is None all list elements are returned.

getcurselection()
Same as getvalue() method.

getvalue()
Return a list of the currently selected items of the listbox.

setlist(items)
Replace all the items of the listbox component with those specified by the items sequence.

setvalue(textOrList)
Set the current selection for the scrolled list to textOrList.

If textOrList is a string, select only the list item specified.

Otherwise, select only the list items specified by textOrList, which must be a sequence of strings.

size()
This method is explicitly forwarded to the listbox component's size() method. Without this explicit forwarding, the size() method (aliased to grid_size()) of the hull would be invoked, which is probably not what the programmer intended.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the ScrolledListBox.
        self.box = Pmw.ScrolledListBox(parent,
                items=('Sydney', 'Melbourne', 'Brisbane'),
                labelpos='nw',
                label_text='Cities',
                listbox_height = 6,
                selectioncommand=self.selectionCommand,
                dblclickcommand=self.defCmd,
                usehullsize = 1,
                hull_width = 200,
                hull_height = 200,
        )

        # Create a group widget to contain the scrollmode options.
        w = Pmw.Group(parent, tag_text='Scroll mode')
        w.pack(side = 'bottom', padx = 5, pady = 5)

        hmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Horizontal:',
                items = ['none', 'static', 'dynamic'],
                command = self.sethscrollmode,
                menubutton_width = 8,
        )
        hmode.pack(side = 'top', padx = 5, pady = 5)
        hmode.invoke('dynamic')

        vmode = Pmw.OptionMenu(w.interior(),
                labelpos = 'w',
                label_text = 'Vertical:',
                items = ['none', 'static', 'dynamic'],
                command = self.setvscrollmode,
                menubutton_width = 8,
        )
        vmode.pack(side = 'top', padx = 5, pady = 5)
        vmode.invoke('dynamic')

        buttonBox = Pmw.ButtonBox(parent)
        buttonBox.pack(side = 'bottom')
        buttonBox.add('yview', text = 'Show\nyview', command = self.showYView)
        buttonBox.add('scroll', text = 'Page\ndown', command = self.pageDown)
        buttonBox.add('center', text = 'Center', command = self.centerPage)

        # Pack this last so that the buttons do not get shrunk when
        # the window is resized.
        self.box.pack(fill = 'both', expand = 1, padx = 5, pady = 5)

        # Do this after packing the scrolled list box, so that the
        # window does not resize as soon as it appears (because
        # alignlabels has to do an update_idletasks).
        Pmw.alignlabels((hmode, vmode))

        # Add some more entries to the listbox.
        items = ('Andamooka', 'Coober Pedy', 'Innamincka', 'Oodnadatta')
        self.box.setlist(items)
        self.box.insert(2, 'Wagga Wagga', 'Perth', 'London')
        self.box.insert('end', 'Darwin', 'Auckland', 'New York')
        index = list(self.box.get(0, 'end')).index('London')
        self.box.delete(index)
        self.box.delete(7, 8)
        self.box.insert('end', 'Bulli', 'Alice Springs', 'Woy Woy')
        self.box.insert('end', 'Wallumburrawang', 'Willandra Billabong')

    def sethscrollmode(self, tag):
        self.box.configure(hscrollmode = tag)

    def setvscrollmode(self, tag):
        self.box.configure(vscrollmode = tag)

    def selectionCommand(self):
        sels = self.box.getcurselection()
        if len(sels) == 0:
            print 'No selection'
        else:
            print 'Selection:', sels[0]

    def defCmd(self):
        sels = self.box.getcurselection()
        if len(sels) == 0:
            print 'No selection for double click'
        else:
            print 'Double click:', sels[0]

    def showYView(self):
        print self.box.yview()

    def pageDown(self):
        self.box.yview('scroll', 1, 'page')

    def centerPage(self):
        top, bottom = self.box.yview()
        size = bottom - top
        middle = 0.5 - size / 2
        self.box.yview('moveto', middle)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 30 August 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ScrolledText.html0000644000175000017500000003510710656147112020240 0ustar serge2serge2 Pmw.ScrolledText reference manual

Pmw.ScrolledText

Name

Pmw.ScrolledText() - text widget with optional scrollbars

Inherits

Pmw.MegaWidget

Description

A scrolled text consists of a standard text widget with optional scrollbars which can be used to scroll the text. The scrollbars can be dynamic, which means that a scrollbar will only be displayed if it is necessary. That is, if the text widget does not contain enough text (either horizontally or vertically), the scrollbar will be automatically hidden. If it is displayed, the horizontal scrollbar is under the text widget. Similarly, if it is displayed, the vertical scrollbar is to the right of the text widget.

Row and column headers may also be displayed, which scroll in sync with the text widget and may be useful when displaying tabular data. To assist in ensuring that columns line up when using a column header, a fixed width font should be used.

Options

Options for this megawidget and its base classes are described below.

borderframe
Initialisation option. If true, the borderframe component will be created. The default is 0.

columnheader
Initialisation option. If true, the columnheader component will be created. The default is 0.

hscrollmode
The horizontal scroll mode. If 'none', the horizontal scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

rowcolumnheader
Initialisation option. If true, the rowcolumnheader component will be created. The default is 0.

rowheader
Initialisation option. If true, the rowheader component will be created. The default is 0.

scrollmargin
Initialisation option. The distance between the scrollbars and the text widget. The default is 2.

usehullsize
Initialisation option. If true, the size of the megawidget is determined solely by the width and height options of the hull component.

Otherwise, the size of the megawidget is determined by the width and height of the text component, along with the size and/or existence of the other components, such as the label, the scrollbars and the scrollmargin option. All these affect the overall size of the megawidget. The default is 0.

vscrollmode
The vertical scroll mode. If 'none', the vertical scrollbar will never be displayed. If 'static', the scrollbar will always be displayed. If 'dynamic', the scrollbar will be displayed only if necessary. The default is 'dynamic'.

Components

Components created by this megawidget and its base classes are described below.

borderframe
A frame widget which snuggly fits around the text widget, to give the appearance of a text border. It is created with a border so that the text widget, which is created without a border, looks like it has a border. By default, this component is a Tkinter.Frame.

columnheader
A text widget with a default height of 1 displayed above the main text widget and which scrolls horizontally in sync with the horizontal scrolling of the main text widget. By default, this component is a Tkinter.Text. Its component group is Header.

horizscrollbar
The horizontal scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

rowcolumnheader
A text widget displayed to the top left of the main text widget, above the row header and to the left of the column header if they exist. The widget is not scrolled automatically. By default, this component is a Tkinter.Text. Its component group is Header.

rowheader
A text widget displayed to the left of the main text widget and which scrolls vertically in sync with the vertical scrolling of the main text widget. By default, this component is a Tkinter.Text. Its component group is Header.

text
The text widget which is scrolled by the scrollbars. If the borderframe option is true, this is created with a borderwidth of 0 to overcome a known problem with text widgets: if a widget inside a text widget extends across one of the edges of the text widget, then the widget obscures the border of the text widget. Therefore, if the text widget has no border, then this overlapping does not occur. By default, this component is a Tkinter.Text.

vertscrollbar
The vertical scrollbar. By default, this component is a Tkinter.Scrollbar. Its component group is Scrollbar.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget. In addition, methods from the Tkinter.Text class are forwarded by this megawidget to the text component.

appendtext(text)
Add text to the end of the text component. Scroll to the bottom of the text, but only if it was already visible before the new text was added.

bbox(index)
This method is explicitly forwarded to the text component's bbox() method. Without this explicit forwarding, the bbox() method (aliased to grid_bbox()) of the hull would be invoked, which is probably not what the programmer intended.

clear()
Delete all text from the text component.

exportfile(fileName)
Write the contents of the text component to the file fileName.

get(first = None, last = None)
This is the same as the get() method of the text component, except that if first is None the entire contents of the text widget are returned.

getvalue()
Return the entire contents of the text widget.

importfile(fileName, where = 'end')
Read the contents of the file fileName and insert into the text component at the position given by where.

settext(text)
Same as setvalue() method.

setvalue(text)
Replace the entire contents of the text component with text.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):

        # Create the ScrolledText with headers.
        fixedFont = Pmw.logicalfont('Fixed')
        self.st = Pmw.ScrolledText(parent,
                # borderframe = 1,
                labelpos = 'n',
                label_text='ScrolledText with headers',
                columnheader = 1,
                rowheader = 1,
                rowcolumnheader = 1,
                usehullsize = 1,
                hull_width = 400,
                hull_height = 300,
                text_wrap='none',
                text_font = fixedFont,
                Header_font = fixedFont,
                Header_foreground = 'blue',
                rowheader_width = 3,
                rowcolumnheader_width = 3,
                text_padx = 4,
                text_pady = 4,
                Header_padx = 4,
                rowheader_pady = 4,
        )

        self.st.pack(padx = 5, pady = 5, fill = 'both', expand = 1)

        funcs = 'atan cos cosh exp log log10 sin sinh sqrt tan tanh'
        funcs = string.split(funcs)

        # Create the header for the row headers
        self.st.component('rowcolumnheader').insert('end', 'x')

        # Create the column headers
        headerLine = ''
        for column in range(len(funcs)):
            headerLine = headerLine + ('%-7s   ' % (funcs[column],))
        headerLine = headerLine[:-3]
        self.st.component('columnheader').insert('0.0', headerLine)

        self.st.tag_configure('yellow', background = 'yellow')

        # Create the data rows and the row headers
        numRows = 50
        tagList = []
        for row in range(1, numRows):
            dataLine = ''
            x = row / 5.0
            for column in range(len(funcs)):
                value = eval('math.' + funcs[column] + '(' + str(x) + ')')
                data = str(value)[:7]
                if value < 0:
                    tag1 = '%d.%d' % (row, len(dataLine))
                    tag2 = '%d.%d' % (row, len(dataLine) + len(data))
                    tagList.append(tag1)
                    tagList.append(tag2)
                data = '%-7s' % (data,)
                dataLine = dataLine + data + '   '
            dataLine = dataLine[:-3]
            header = '%.1f' % (x,)
            if row < numRows - 1:
                dataLine = dataLine + '\n'
                header = header + '\n'
            self.st.insert('end', dataLine)
            self.st.component('rowheader').insert('end', header)
        apply(self.st.tag_add, ('yellow',) + tuple(tagList))

        # Prevent users' modifying text and headers
        self.st.configure(
            text_state = 'disabled',
            Header_state = 'disabled',
        )

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 30 August 1998

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/SelectionDialog.html0000644000175000017500000002271410656147112020671 0ustar serge2serge2 Pmw.SelectionDialog reference manual

Pmw.SelectionDialog

Name

Pmw.SelectionDialog() - selection dialog displaying a scrolled list

Inherits

Pmw.Dialog

Description

The selection dialog is a dialog window which displays a scrolled list which can be used to prompt the user for a value.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

borderx
Initialisation option. The padding to the left and right of the scrolled list. The default is 10.

bordery
Initialisation option. The padding above and below the scrolled list. The default is 10.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('OK',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

scrolledlist
The scrolled list for the user to enter a value. By default, this component is a Pmw.ScrolledListBox.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

label
Alias for scrolledlist_label.
listbox
Alias for scrolledlist_listbox.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.Dialog. In addition, methods from the Pmw.ScrolledListBox class are forwarded by this megawidget to the scrolledlist component.

bbox(index)
This method is explicitly forwarded to the listbox component's bbox() method. Without this explicit forwarding, the bbox() method (aliased to grid_bbox()) of the hull would be invoked, which is probably not what the programmer intended.

size()
This method is explicitly forwarded to the listbox component's size() method. Without this explicit forwarding, the size() method (aliased to grid_size()) of the hull would be invoked, which is probably not what the programmer intended.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the dialog.
        self.dialog = Pmw.SelectionDialog(parent,
            title = 'My SelectionDialog',
            buttons = ('OK', 'Cancel'),
            defaultbutton = 'OK',
            scrolledlist_labelpos = 'n',
            label_text = 'What do you think of Pmw?',
            scrolledlist_items = ('Cool man', 'Cool', 'Good', 'Bad', 'Gross'),
            command = self.execute)
        self.dialog.withdraw()

        # Create button to launch the dialog.
        w = Tkinter.Button(parent, text = 'Show selection dialog',
                command = self.dialog.activate)
        w.pack(padx = 8, pady = 8)

    def execute(self, result):
        sels = self.dialog.getcurselection()
        if len(sels) == 0:
            print 'You clicked on', result, '(no selection)'
        else:
            print 'You clicked on', result, sels[0]
        self.dialog.deactivate(result)

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/TextDialog.html0000644000175000017500000002315210656147112017665 0ustar serge2serge2 Pmw.TextDialog reference manual

Pmw.TextDialog

Name

Pmw.TextDialog() - a dialog displaying a scrolled text

Inherits

Pmw.Dialog

Description

A text dialog is a dialog window which displays a text message to the user along with one or more buttons to press.

Options

Options for this megawidget and its base classes are described below.

activatecommand
If this is callable, it will be called whenever the megawidget is activated by a call to activate(). The default is None.

borderx
Initialisation option. The padding to the left and right of the scrolled text. The default is 10.

bordery
Initialisation option. The padding above and below the scrolled text. The default is 10.

buttonboxpos
Initialisation option. Specifies on which side of the dialog window to place the button box. Must be one of 'n', 's', 'e' or 'w'. The default is 's'.

buttons
This must be a tuple or a list and specifies the names on the buttons in the button box. The default is ('OK',).

command
Specifies a function to call whenever a button in the button box is invoked or the window is deleted by the window manager. The function is called with a single argument, which is the name of the button which was invoked, or None if the window was deleted by the window manager.

If the value of command is not callable, the default behaviour is to deactivate the window if it is active, or withdraw the window if it is not active. If it is deactivated, deactivate() is called with the button name or None as described above. The default is None.

deactivatecommand
If this is callable, it will be called whenever the megawidget is deactivated by a call to deactivate(). The default is None.

defaultbutton
Specifies the default button in the button box. If the <Return> key is hit when the dialog has focus, the default button will be invoked. If defaultbutton is None, there will be no default button and hitting the <Return> key will have no effect. The default is None.

master
This is used by the activate() method to control whether the window is made transient during modal dialogs. See the activate() method. The default is 'parent'.

separatorwidth
Initialisation option. If this is greater than 0, a separator line with the specified width will be created between the button box and the child site, as a component named separator. Since the default border of the button box and child site is raised, this option does not usually need to be set for there to be a visual separation between the button box and child site. The default is 0.

title
This is the title that the window manager displays in the title bar of the window. The default is None.

Components

Components created by this megawidget and its base classes are described below.

buttonbox
This is the button box containing the buttons for the dialog. By default it is created with the options (hull_borderwidth = 1, hull_relief = 'raised'). By default, this component is a Pmw.ButtonBox.

dialogchildsite
This is the child site for the dialog, which may be used to specialise the megawidget by creating other widgets within it. By default it is created with the options (borderwidth = 1, relief = 'raised'). By default, this component is a Tkinter.Frame.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Toplevel.

scrolledtext
The scrolled text to contain the text for the dialog. By default, this component is a Pmw.ScrolledText.

separator
If the separatorwidth initialisation option is non-zero, the separator component is the line dividing the area between the button box and the child site. By default, this component is a Tkinter.Frame.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

label
Alias for scrolledtext_label.
text
Alias for scrolledtext_text.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.Dialog. In addition, methods from the Pmw.ScrolledText class are forwarded by this megawidget to the scrolledtext component.

bbox(index)
This method is explicitly forwarded to the text component's bbox() method. Without this explicit forwarding, the bbox() method (aliased to grid_bbox()) of the hull would be invoked, which is probably not what the programmer intended.

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        # Create the dialog.
        dialog = Pmw.TextDialog(parent, scrolledtext_labelpos = 'n',
                title = 'My TextDialog',
                defaultbutton = 0,
                label_text = 'Lawyer jokes')
        dialog.withdraw()
        dialog.insert('end', jokes)
        dialog.configure(text_state = 'disabled')

        # Create button to launch the dialog.
        w = Tkinter.Button(parent, text = 'Show text dialog',
                command = dialog.activate)
        w.pack(padx = 8, pady = 8)

jokes = """
Q: What do you call 5000 dead lawyers at the bottom of the ocean?
A: A good start!

Q: How can you tell when a lawyer is lying?
A: His lips are moving.

Q: Why won't sharks attack lawyers?
A: Professional courtesy.

Q: What do have when a lawyer is buried up to his neck in sand?
A: Not enough sand.

Q: How do you get a lawyer out of a tree?
A: Cut the rope.

Q: What is the definition of a shame (as in "that's a shame")?
A: When a bus load of lawyers goes off a cliff.

Q: What is the definition of a "crying shame"?
A: There was an empty seat.

Q: What do you get when you cross the Godfather with a lawyer?
A: An offer you can't understand.

Q. What do lawyers use as contraceptives?
A. Their personalities.

Q. What's brown and black and looks good on a lawyer?
A. A doberman.

Q. Why are lawyers buried 12 feet underground?
A. Deep down their good.

Q. What's the difference between a catfish and a lawyer?
A. One's a slimy scum-sucking scavenger, the other is just a fish.

"""

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 18 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/TimeCounter.html0000644000175000017500000002770010656147112020062 0ustar serge2serge2 Pmw.TimeCounter reference manual

Pmw.TimeCounter

Name

Pmw.TimeCounter() - counter for display and input of time

Inherits

Pmw.MegaWidget

Description

A time counter is similar to a regular Pmw.Counter except that the user may increment and decrement the hours, minutes and seconds individually.

Options

Options for this megawidget and its base classes are described below.

autorepeat
If true, the counter will continue to count up or down while an arrow button is held pressed down. The default is 1.

buttonaspect
Initialisation option. Specifies the width of the arrow buttons as a proportion of their height. Values less than 1.0 will produce thin arrow buttons. Values greater than 1.0 will produce fat arrow buttons. The default is 1.0.

command
This specifies a function to call whenever the <Return> key is pressed in one of the entry fields or invoke() is called. The default is None.

initwait
Specifies the initial delay (in milliseconds) before a depressed arrow button automatically starts to repeat counting. The default is 300.

labelmargin
Initialisation option. If the labelpos option is not None, this specifies the distance between the label component and the rest of the megawidget. The default is 0.

labelpos
Initialisation option. Specifies where to place the label component. If not None, it should be a concatenation of one or two of the letters 'n', 's', 'e' and 'w'. The first letter specifies on which side of the megawidget to place the label. If a second letter is specified, it indicates where on that side to place the label. For example, if labelpos is 'w', the label is placed in the center of the left hand side; if it is 'wn', the label is placed at the top of the left hand side; if it is 'ws', the label is placed at the bottom of the left hand side.

If None, a label component is not created. The default is None.

max
Specifies the maximum acceptable time in the form "HH:MM:SS", or None if no maximum checking should be performed. The default is None.

min
Specifies the minimum acceptable time in the form "HH:MM:SS", or None if no minimum checking should be performed. The default is None.

padx
Initialisation option. Specifies how much wider to make each column than the default width (where a column consists of two arrows and an entry field). The entry fields expand to fill the extra space, but the arrow buttons are centered in the available space. The default is 0.

pady
Initialisation option. Specifies how much higher to make each row of arrow buttons than the default hight. The arrow buttons are centered in the available space. The default is 0.

repeatrate
Specifies the delay (in milliseconds) between automatic counts while an arrow button is held pressed down. The default is 50.

value
Initialisation option. Specifies the initial contents of the time counter, in the form "HH:MM:SS". If this is None, the current time is used as the initial contents. The default is None.

Components

Components created by this megawidget and its base classes are described below.

downhourarrow
The arrow button used for decrementing the hour field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

downminutearrow
The arrow button used for decrementing the minute field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

downsecondarrow
The arrow button used for decrementing the second field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

frame
If the label component has been created (that is, the labelpos option is not None), the frame component is created to act as the container of the entry fields and arrow buttons. If there is no label component, then no frame component is created and the hull component acts as the container. In either case the border around the container of the entry fields and arrow buttons will be raised (but not around the label). By default, this component is a Tkinter.Frame.

hourentryfield
The entry field where the hours are entered and displayed. By default, this component is a Pmw.EntryField.

hull
This acts as the body for the entire megawidget. Other components are created as children of the hull to further specialise this class. By default, this component is a Tkinter.Frame.

label
If the labelpos option is not None, this component is created as a text label for the megawidget. See the labelpos option for details. Note that to set, for example, the text option of the label, you need to use the label_text component option. By default, this component is a Tkinter.Label.

minuteentryfield
The entry field where the minutes are entered and displayed. By default, this component is a Pmw.EntryField.

secondentryfield
The entry field where the seconds are entered and displayed. By default, this component is a Pmw.EntryField.

uphourarrow
The arrow button used for incrementing the hour field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

upminutearrow
The arrow button used for incrementing the minute field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

upsecondarrow
The arrow button used for incrementing the second field. By default, this component is a Tkinter.Canvas. Its component group is Arrow.

Component aliases

Sub-components of components of this megawidget may be accessed via the following aliases.

hourentry
Alias for hourentryfield_entry.
minuteentry
Alias for minuteentryfield_entry.
secondentry
Alias for secondentryfield_entry.

Methods

Only methods specific to this megawidget are described below. For a description of its inherited methods, see the manual for its base class Pmw.MegaWidget.

decrement(seconds = 1)
Decrement the time by seconds seconds.

getint()
Return the currently displayed time as a number of seconds.

getstring()
Same as getvalue() method.

getvalue()
Return the currently displayed time as a string in the form "HH:MM:SS".

increment(seconds = 1)
Increment the time by seconds seconds.

invoke()
Invoke the command specified by the command option as if the <Return> key had been pressed.

setvalue(text)
Set the contents of the time counter, where text must be in the form "HH:MM:SS".

Example

The image at the top of this manual is a snapshot of the window (or part of the window) produced by the following code.

class Demo:
    def __init__(self, parent):
        self._time = Pmw.TimeCounter(parent,
                labelpos = 'w',
                label_text = 'HH:MM:SS',
                min = '00:00:00',
                max = '23:59:59')
        self._time.pack(padx=10, pady=5)

        button = Tkinter.Button(parent, text = 'Show', command = self.show)
        button.pack()

    def show(self):
        stringVal = self._time.getstring()
        intVal =  self._time.getint()
        print stringVal + '  (' + str(intVal) + ')'

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 25 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/PmwFunctions.html0000644000175000017500000007711010656147112020260 0ustar serge2serge2 Pmw functions reference manual

Pmw functions

Pmw.aboutcontact(value)

The value passed to this function is used to construct the text displayed by Pmw.AboutDialog megawidgets created subsequently.

Pmw.aboutcopyright(value)

The value passed to this function is used to construct the text displayed by Pmw.AboutDialog megawidgets created subsequently.

Pmw.aboutversion(value)

The value passed to this function is used to construct the text displayed by Pmw.AboutDialog megawidgets created subsequently.

Pmw.aligngrouptags(groups)

This function takes a sequence of Pmw.Groups and adjusts the vertical position of the tags in each group so that they all have the height of the tallest tag. This can be used when groups are positioned side-by-side but the natural height of the tags are different because, for example, different fonts with different sizes are used.

Pmw.alignlabels(widgets, sticky = None)

Adjust the size of the labels of all the widgets to be equal, so that the body of each widget lines up vertically. This assumes that each widget is a megawidget with a label component in column 0 (ie, the labelpos option was set to 'w', 'wn' or 'ws'). If sticky is set to a combination of 'n', 's', 'e' and 'w', the label will be positioned within its cell accordingly. For example to make labels right justified, set sticky to 'e', 'ne' or 'se'.

Pmw.alphabeticvalidator(text)

Validator function for Pmw.EntryField alphabetic standard validator.

Pmw.alphanumericvalidator(text)

Validator function for Pmw.EntryField alphanumeric standard validator.

Pmw.busycallback(command, updateFunction = None)

Create a wrapper function which displays a busy cursor while executing command and return the wrapper. When the wrapper function is called, it first calls Pmw.showbusycursor(), then the command (passing any arguments to it), then Pmw.hidebusycursor(). The return value of command is returned from the wrapper.

If updateFunction is specified, it is called just before the call to Pmw.hidebusycursor(). This is intended to be the Tkinter update() method, in which case it will clear any events that may have occurred while command was executing. An example of this usage is in the ShowBusy demonstration: run the demonstration, click on the entry widget then click on the button and type some characters while the busy cursor is displayed. No characters should appear in the entry widget.

Note that the Tkinter update() method should only be called when it is known that it can be safely called. One case where a problem has been found is when a filehandler has been created (on a non-blocking Oracle database connection), but the filehandler does not read from the connection. The connection is read (by a call to the Oracle fetch function ofen) in a loop which also contains a call to _tkinter.dooneevent(). If update() is called from dooneevent() and there is data to be read on the connection, then the filehandler will be called continuously, thus hanging the application.

Pmw.clearbusycursor()

Unconditionally remove the event block and busy cursor from all windows. This undoes all outstanding calls to Pmw.showbusycursor().

Pmw.datestringtojdn(text, format = 'ymd', separator = '/')

Return the Julian Day Number corresponding to the date in text. A Julian Day Number is defined as the number of days since 1 Jan 4713 BC. The date must be specified as three integers separated by the separator character. The integers must be in the order specified by format, which must be a combination of 'd', 'm' and 'y' in any order. These give the order of the day, month and year fields. Examples of valid input are:

 'dmy':  31/01/99  31/1/1999  31/1/99
 'mdy':  01/31/99  1/31/1999  1/31/99
 'ymd':  99/01/31  1999/1/31  99/1/31

If the application's pivot year (default 50) is not None and the year specified in text has only one or two digits, then the year is converted to a four digit year. If it is less than or equal to the pivot year, then it is incremented by the application's century value (default 2000). If it is more than the pivot year then it is incremented by the century value less 100.

The function Pmw.setyearpivot() can be used to change the default values for the application's pivot and century.

Pmw.datevalidator(text, format = 'ymd', separator = '/')

Validator function for Pmw.EntryField date standard validator.

Pmw.displayerror(text)

This is a general purpose method for displaying background errors to the user. The errors would normally be programming errors and may be caused by errors in Tk callbacks or functions called by other asynchronous events.

If the global error report file (set by calling Pmw.reporterrorstofile()) is None, the error message `text` is written to standard error and also shown in a text window. If displayerror is called while previous error messages are being displayed, the window is raised and the new error is queued. The queued errors may be viewed by the user or ignored by dismissing the window.

If the global error report file is not None, `text` is written to the file. file may be any object with a write() method, such as sys.stderr.

Pmw.drawarrow(canvas, color, direction, tag, baseOffset = 0.25, edgeOffset = 0.15)

Draw a triangle in the Tkinter.Canvas canvas in the given color. The value of direction may be 'up', 'down', 'left' or 'right' and specifies which direction the arrow should point. The values of baseOffset and edgeOffset specify how far from the edges of the canvas the points of the triangles are as a fraction of the size of the canvas.

Pmw.forwardmethods(fromClass, toClass, toPart, exclude = ())

Forward methods from one class to another.

This function adds methods to the class fromClass. The names of the methods added are the names of the methods of the class toClass (and its base classes) except those which are already defined by fromClass or are found in the exclude list. Special methods with one or more leading or trailing underscores are also excluded.

When one of the added methods is called, the method of the same name is called on an instance defined by toPart and the return value passed back. If toPart is a string, then it specifies the name of an attribute (not a component) of the fromClass object. The class of this attribute should be toClass. If toPart is not a string, it must be a function taking a fromClass object and returning a toClass object.

This function must be called outside of and after the definition of fromClass.

For example:

class MyClass:
    def __init__(self):
        ...
        self.__target = TargetClass()
        ...

    def foo(self):
        pass

    def findtarget(self):
        return self.__target

Pmw.forwardmethods(MyClass, TargetClass, '__target',
    ['dangerous1', 'dangerous2'])

# ...or...

Pmw.forwardmethods(MyClass, TargetClass,
    MyClass.findtarget, ['dangerous1', 'dangerous2'])

In both cases, all TargetClass methods will be forwarded from MyClass except for dangerous1, dangerous2, special methods like __str__, and pre-existing methods like foo.

Pmw.grabstacktopwindow()

Return the window at the top of the grab stack (the window currently with the grab) or None if the grab stack is empty (no window has the grab). See also pushgrab().

Pmw.hexadecimalvalidator(text)

Validator function for Pmw.EntryField hexadecimal standard validator.

Pmw.hidebusycursor(forceFocusRestore = 0)

Undo one call to Pmw.showbusycursor(). If there are no outstanding calls to Pmw.showbusycursor(), remove the event block and busy cursor.

If the focus window has not been changed since the corresponding call to Pmw.showbusycursor(), or if forceFocusRestore is true, then the focus is restored to that saved by Pmw.showbusycursor().

Pmw.initialise(root = None, size = None, fontScheme = None, useTkOptionDb = 0, noBltBusy = 0, disableKeyboardWhileBusy = None)

Initialise Pmw. This performs several functions:

It is not absolutely necessary to call this function to be able to use Pmw. However, some functionality will be lost. Most importantly, Pmw megawidgets will not be notified when their hull widget is destroyed. This may prevent the megawidget from cleaning up timers which will try to access the widget, hence causing a background error to occur.

Pmw.installedversions(alpha = 0)

If alpha is false, return the list of base versions of Pmw that are currently installed and available for use. If alpha is true, return the list of alpha versions.

Pmw.integervalidator(text)

Validator function for Pmw.EntryField integer standard validator.

Pmw.jdntoymd(jdn, julian = -1, papal = 1)

Return the year, month and day of the Julian Day Number jdn. If julian is 1, then the date returned will be in the Julian calendar. If julian is 0, then the date returned will be in the modern calendar. If julian is -1, then which calendar to use will be automatically determined by the value of jdn and papal. If papal is true, then the date set by Pope Gregory XIII's decree (4 October 1582) will be used as the last day to use the Julian calendar. If papal is false, then the last day to use the Julian calendar will be according to British-American usage (2 September 1752).

Pmw.logicalfont(name = 'Helvetica', sizeIncr = 0, **kw)

Return the full name of a Tk font, being a hyphen-separated list of font properties. The logical name of the font is given by name and may be one of 'Helvetica', 'Times', 'Fixed', 'Courier' or 'Typewriter'. Pmw uses this name to define the default values of many of the font properties. The size of the font is the base font size for the application specified in the call to Pmw.initialise() increased or decreased by the value of sizeIncr. The other properties of the font may be specified by other named arguments. These may be 'registry', 'foundry', 'family', 'weight', 'slant', 'width', 'style', 'pixel', 'size', 'xres', 'yres', 'spacing', 'avgwidth', 'charset' and 'encoding'.

Pmw.logicalfontnames()

Return the list of known logical font names that can be given to Pmw.logicalfont().

Pmw.numericvalidator(text)

Validator function for Pmw.EntryField numeric standard validator.

Pmw.popgrab(window)

Remove window from the grab stack. If there are not more windows in the grab stack, release the grab. Otherwise set the grab and the focus to the next window in the grab stack. See also pushgrab().

Pmw.pushgrab(grabWindow, globalMode, deactivateFunction)

The grab functions (pushgrab(), popgrab(), releasegrabs() and grabstacktopwindow()) are an interface to the Tk grab command which implements simple pointer and keyboard grabs. When a grab is set for a particular window, Tk restricts all pointer events to the grab window and its descendants in Tk's window hierarchy. The functions are used by the activate() and deactivate() methods to implement modal dialogs.

Pmw maintains a stack of grabbed windows, where the window on the top of the stack is the window currently with the grab. The grab stack allows nested modal dialogs, where one modal dialog can be activated while another modal dialog is activated. When the second dialog is deactivated, the first dialog becomes active again.

Use pushgrab() to add grabWindow to the grab stack. This releases the grab by the window currently on top of the stack (if there is one) and gives the grab and focus to the grabWindow. If globalMode is true, perform a global grab, otherwise perform a local grab. The value of deactivateFunction specifies a function to call (usually grabWindow.deactivate) if popgrab() is called (usually from a deactivate() method) on a window which is not at the top of the stack (that is, does not have the grab or focus). For example, if a modal dialog is deleted by the window manager or deactivated by a timer. In this case, all dialogs above and including this one are deactivated, starting at the top of the stack.

For more information, see the Tk grab manual page.

Pmw.realvalidator(text, separator = '.')

Validator function for Pmw.EntryField real standard validator.

Pmw.releasegrabs()

Release grab and clear the grab stack. This should normally not be used, use popgrab() instead. See also pushgrab().

Pmw.reporterrorstofile(file = None)

Sets the global error report file, which is initially None. See Pmw.displayerror()

Pmw.setalphaversions(*alpha_versions)

Set the list of alpha versions of Pmw to use for this session to the arguments. When searching for Pmw classes and functions, these alpha versions will be searched, in the order given, before the base version. This must be called before any other Pmw class or function, except functions setting or querying versions.

Pmw.setbusycursorattributes(window, **kw)

Use the keyword arguments to set attributes controlling the effect on window (which must be a Tkinter.Toplevel) of future calls to Pmw.showbusycursor(). The attributes are:

exclude
a boolean value which specifies whether the window will be affected by calls to Pmw.showbusycursor(). If a window is excluded, then the cursor will not be changed to a busy cursor and events will still be delivered to the window. By default, windows are affected by calls to Pmw.showbusycursor().

cursorName
the name of the cursor to use when displaying the busy cursor. If None, then the default cursor is used.

Pmw.setgeometryanddeiconify(window, geom)

Deiconify and raise the toplevel window and set its position and size according to geom. This overcomes some problems with the window flashing under X and correctly positions the window under NT (caused by Tk bugs).

Pmw.setversion(version)

Set the version of Pmw to use for this session to version. If Pmw.setversion() is not called, the latest installed version of Pmw will be used. This must be called before any other Pmw class or function, except functions setting or querying versions.

Pmw.setyearpivot(pivot, century = None)

Set the pivot year and century for the application's date processing. These values are used in the datestringtojdn() method, which is used by Pmw.Counter and Pmw.EntryField and derived classes. The initial values of pivot and century are 50 and 2000 repectively. Return a tuple containing the old values of pivot and century.

Pmw.showbusycursor()

Block events to and display a busy cursor over all windows in this application that are in the state 'normal' or 'iconic', except those windows whose exclude busycursor attribute has been set to true by a call to Pmw.setbusycursorattributes().

If a window and its contents have just been created, update_idletasks() may have to be called before Pmw.showbusycursor() so that the window is mapped to the screen. Windows created or deiconified after calling Pmw.showbusycursor() will not be blocked.

To unblock events and remove the busy cursor, use Pmw.hidebusycursor(). Nested calls to Pmw.showbusycursor() may be made. In this case, a matching number of calls to Pmw.hidebusycursor() must be made before the event block and busy cursor are removed.

If the BLT extension to Tk is not present, this function has no effect other than to save the value of the current focus window, to be later restored by Pmw.hidebusycursor().

Pmw.stringtoreal(text, separator = '.')

Return the real number represented by text. This is similar to string.atof() except that the character representing the decimal point in text is given by separator.

Pmw.timestringtoseconds(text, separator = ':')

Return the number of seconds corresponding to the time in text. The time must be specified as three integers separated by the separator character and must be in the order hours, minutes and seconds. The first number may be negative, indicating a negative time.

Pmw.timevalidator(text, separator = ':')

Validator function for Pmw.EntryField time standard validator.

Pmw.tracetk(root = None, on = 1, withStackTrace = 0, file = None)

Print debugging trace of calls to, and callbacks from, the Tk interpreter associated with the root window . If root is None, use the Tkinter default root. If on is true, start tracing, otherwise stop tracing. If withStackTrace is true, print a python function call stacktrace after the trace for each call to Tk. If file is None, print to standard error, otherwise print to the file given by file.

For each call to Tk, the Tk command and its options are printed as a python tuple, followed by the return value of the command (if not the empty string). For example:

python executed:
  button = Tkinter.Button()
  button.configure(text = 'Hi')

tracetk output:
  CALL  TK> 1:  ('button', '.3662448') -> '.3662448'
  CALL  TK> 1:  ('.3662448', 'configure', '-text', 'Hi')

Some calls from python to Tk (such as update, tkwait, invoke, etc) result in the execution of callbacks from Tk to python. These python callbacks can then recursively call into Tk. When displayed by tracetk(), these recursive calls are indented proportionally to the depth of recursion. The depth is also printed as a leading number. The return value of a call to Tk which generated recursive calls is printed on a separate line at the end of the recursion. For example:

python executed:
  def callback():
      button.configure(text = 'Bye')
      return 'Got me!'
  button = Tkinter.Button()
  button.configure(command = callback)
  button.invoke()
tracetk output:
  CALL  TK> 1:  ('button', '.3587144') -> '.3587144'
  CALL  TK> 1:  ('.3587144', 'configure', '-command', '3638368callback')
  CALL  TK> 1:  ('.3587144', 'invoke')
  CALLBACK> 2:    callback()
  CALL  TK> 2:    ('.3587144', 'configure', '-text', 'Bye')
  CALL RTN> 1:  -> 'Got me!'

Pmw.initialise() must be called before tracetk() so that hooks are put into the Tkinter CallWrapper class to trace callbacks from Tk to python and also to handle recursive calls correctly.

Pmw.version(alpha = 0)

If alpha is false, return the base version of Pmw being used for this session. If Pmw.setversion() has not been called, this will be the latest installed version of Pmw. If alpha is true, return the list of alpha versions of Pmw being used for this session, in search order. If Pmw.setalphaversions() has not been called, this will be the empty list.

Pmw.ymdtojdn(year, month, day, julian = -1, papal = 1)

Return the Julian Day Number corresponding to year, month and day. See jdntoymd() for description of other arguments)

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/Color.html0000644000175000017500000003111410656147112016674 0ustar serge2serge2 Pmw.Color reference manual

Pmw.Color

Name

Pmw.Color - contains functions for handling colors and color schemes

Description

This module is a set of functions for manipulating colors and for modifying the color scheme of an application or a widget. Many of the functions in this module take or return colors. These values may represent colors in the following ways:

name
a standard color name, eg 'orange' or '#ffa500'

rgb
a 3-element sequence of red, green and blue intensities each between 0.0 (dark) and 1.0 (light), eg [1.0, 0.6, 0.0].

hsi
a 3-element sequence (hue, saturation, intensity). The value of hue is between 0.0 and 2pi (6.28318) giving a range of colors covering, in order, red, orange, yellow green, cyan, blue, magenta and back to red. The value of saturation is between 0.0 (grey) and 1.0 (brilliant) and the value of intensity is between 0.0 (dark) and 1.0 (bright).

As used in these functions, the brightness of a color is the perceived grey level of the color as registered by the human eye. For example, even though the colors red, blue and yellow have the same intensity (1.0), they have different brightnesses, 0.299, 0.114 and 0.886 respectively, reflecting the different way these colors appear to the eye. The brightness of a color is a value between 0.0 (dark) and 1.0 (bright).

A color scheme is a set of colors defined for each of the default color options in the Tk option database. Color schemes can be used in two ways. Firstly, using Pmw.Color.setscheme(), the Tk option database can be set to the values in the color scheme. This will not have any effect on currently existing widgets, but any new widgets created after setting the options will have these colors as their defaults. Secondly, using Pmw.Color.changecolor() the color scheme can be used to change the colors of a widget and all its child widgets.

A color scheme is specified by defining one or more color options (one of the defined options must be background). Not all options need be specified - if any options are not defined, they are calculated from the other colors. These are the options used by a color scheme, together with their values if not specified:

 background:            (must be specified)
 foreground:            black
 activeForeground:      same as foreground
 insertBackground:      same as foreground
 selectForeground:      same as foreground
 highlightColor:        same as foreground
 disabledForeground:    between fg and bg but closer to bg
 highlightBackground:   same as background
 activeBackground:      a little lighter that bg
 selectBackground:      a little darker that bg
 troughColor:           a little darker that bg
 selectColor:           yellow

There are many functions in this module. As well as Pmw.Color.setscheme() and Pmw.Color.changecolor(), some of the most useful are Pmw.Color.spectrum(), Pmw.Color.changebrightness() and Pmw.Color.getdefaultpalette().

Functions

The following functions are available.

Pmw.Color.average(rgb1, rgb2, fraction)
Return an rgb color fraction of the way "between" the colors rgb1 and rgb2, where fraction must be between 0.0 and 1.0. If fraction is close to 0.0, then the color returned will be close to rgb1. If it is close to 1.0, then the color returned will be close to rgb2. If it is near 0.5, then the color returned will be half way between the two colors.

Pmw.Color.bhi2saturation(brightness, hue, intensity)
Return the saturation of the color represented by brightness, hue and intensity.

Pmw.Color.bordercolors(root, colorName)
Return a tuple (light, dark) of color names that can be used as the light and dark border shadows on a widget where the background is colorName. This is the same method that Tk uses for shadows when drawing reliefs on widget borders. The root argument is only used to query Tk for the rgb values of colorName.

Pmw.Color.changebrightness(root, colorName, brightness)
Find the hue of the color colorName and return a color of this hue with the required brightness. If brightness is None, return the name of color with the given hue and with saturation and intensity both 1.0. The root argument is only used to query Tk for the rgb values of colorName.

Pmw.Color.changecolor(widget, background = None, **kw)
Change the color of widget and all its child widgets according to the color scheme specified by the other arguments. This is done by modifying all of the color options of existing widgets that have the default value. The color options are the lower case versions of those described in the color scheme section. Any options which are different to the previous color scheme (or the defaults, if this is the first call) are not changed.

For example to change a widget to have a red color scheme with a white foreground:

 Pmw.Color.changecolor(widget,
     background = 'red3', foreground = 'white')

The colors of widgets created after this call will not be affected.

Note that widget must be a Tk widget or toplevel. To change the color of a Pmw megawidget, use it's hull component. For example:

 widget = megawidget.component('hull')
 Pmw.Color.changecolor(widget, background = 'red3')

Pmw.Color.correct(rgb, correction)
Return the "corrected" value of rgb. This can be used to correct for dull monitors. If correction is less than 1.0, the color is dulled. If correction is greater than 1.0, the color is brightened.

Pmw.Color.getdefaultpalette(root)
Return a dictionary of the default values of the color options described in the color scheme section.

To do this, a few widgets are created as children of root, their defaults are queried, and then the widgets are destroyed. (Tk supplies no other way to get widget default values.)

Note that root must be a Tk widget or toplevel. To use a Pmw megawidget as the root, use it's hull component. For example:

 root = megawidget.component('hull')
 Pmw.Color.getdefaultpalette(root)

Pmw.Color.hsi2rgb(hue, saturation, intensity)
Return the rgb representation of the color represented by hue, saturation and intensity.

Pmw.Color.hue2name(hue, brightness = None)
Return the name of the color with the specified hue and brightness. If hue is None, return a grey of the requested brightness. Otherwise, the value of hue should be as described above. If brightness is None, return the name of color with the given hue and with saturation and intensity both 1.0.

Pmw.Color.name2rgb(root, colorName, asInt = 0)
Return colorName as an rgb value. If asInt is true, then the elements of the return sequence are in the range 0 to 65535 rather than 0.0 to 1.0. The root argument is only used to query Tk for the rgb values of colorName.

Pmw.Color.rgb2brightness(rgb)
Return the brightness of the color represented by rgb.

Pmw.Color.rgb2hsi(rgb)
Return a tuple (hue, saturation, intensity) corresponding to the color specified by the rgb sequence.

Pmw.Color.rgb2name(rgb)
Return the name of the color represented by rgb as a string of the form '#RRGGBB' suitable for use with Tk color functions.

Pmw.Color.setscheme(root, background = None, **kw)
Set the color scheme for the application by setting default colors (in the Tk option database of the root window of root) according to the color scheme specified by the other arguments. This will affect the initial colours of all widgets created after the call to this function.

For example to initialise an application to have a red color scheme with a white foreground:

 Pmw.Color.setscheme(root,
     background = 'red3', foreground = 'white')

This function does not modify the colors of already existing widgets. Use Pmw.Color.changecolor() to do this.

Note that root must be a Tk widget or toplevel. To use the Tk option database of the root window of a Pmw megawidget, use the megawidget's hull component. For example:

 root = megawidget.component('hull')
 Pmw.Color.setscheme(root, background = 'red3')

Pmw.Color.spectrum(numColors, correction = 1.0, saturation = 1.0, intensity = 1.0, extraOrange = 1, returnHues = 0)
Return a list of numColors different colors making up a spectrum. If extraOrange is false, the colors are evenly spaced by hue from one end of the spectrum (red) to the other (magenta). If extraOrange is true, the hues are not quite evenly spaced - the hues around orange are emphasised, thus preventing the spectrum from appearing to have to many cool hues.

If returnHues is false, the return values are the names of the colors represented by the hues together with saturation and intensity and corrected by correction.

If returnHues is true, the return values are hues.

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 25 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/Blt.html0000644000175000017500000000716210656147112016345 0ustar serge2serge2 Pmw.Blt reference manual

Pmw.Blt

Name

Pmw.Blt - interface to some BLT widgets and commands

Description

This module contains function interfaces to the BLT busy command as well as the classes Pmw.Blt.Vector, Pmw.Blt.Graph, Pmw.Blt.Stripchart and Pmw.Blt.Tabset, which are interfaces to the vector, graph, stripchart and tabset commands of version 2.4 of the BLT extension to Tk. The interfaces are complete except for Pmw.Blt.Vector where several creation options, methods and operations have not been implemented.

The blt graph and barchart widgets are essentially the same and so only the graph widget has been ported. The element_create() method is not implememted for Pmw.Blt.Graph, so instead:

To operate on elements, use the element_*() methods, such as element_bind(), element_activate(), etc.

Note: Full documentation of Pmw.Blt.Graph is available in A User's Guide to Pmw.Blt written by Bjorn Ove Thue and Hans Petter Langtangen. You can also download the full HTML document of the guide for local viewing.

Functions

The following functions are available.

Pmw.Blt.busy_forget(window)
Interface to the BLT busy forget command.

Pmw.Blt.busy_hold(window, cursor = None)
Interface to the BLT busy hold command.

Pmw.Blt.busy_release(window)
Interface to the BLT busy release command.

Pmw.Blt.haveblt(window)
Return true if any commands in the BLT extension are available.

Pmw.Blt.havebltbusy(window)
Return true if the BLT busy command is available.

Pmw.Blt.vector_expr(expression)
Interface to the BLT vector expr command.

Pmw.Blt.vector_names(pattern = None)
Interface to the BLT vector names command.

Pmw 1.3 - 7 Aug 2007 - Home
Manual page last reviewed: 25 May 2002

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/features.html0000644000175000017500000000531610656147112017441 0ustar serge2serge2 Pmw features

Pmw features

Pmw is a toolkit for building high-level compound widgets, or megawidgets, constructed using other widgets as component parts. It promotes consistent look and feel within and between graphical applications, is highly configurable to your needs and is easy to use.

Pmw consists of:

The interface to Pmw megawidgets is similar to basic Tk widgets, so it is easy for developers to include both megawidgets and basic Tk widgets in their graphical applications. In addition, Pmw megawidgets may themselves be extended, using either inheritance or composition.

The use of the Pmw megawidgets replaces common widget combinations with higher level abstractions. This simplifies code, making it more readable and maintainable. The ability to extend Pmw megawidgets enables developers to create new megawidgets based on previous work.

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/changes.html0000644000175000017500000015654310656147112017244 0ustar serge2serge2 Changes to Pmw

Changes to Pmw

6 January 1997

14 February 1997

14 February 1997

6 March 1997

13 March 1997

17 March 1997

28 April 1997

19 August 1997

1 September 1997

5 September 1997

9 September 1997

19 September 1997

16 October 1997

24 October 1997

29 October 1997

7 November 1997

10 November 1997

12 November 1997

5 December 1997

9 December 1997

10 December 1997

16 December 1997

30 December 1997

5 January 1998

7 January 1998

8 January 1998

12 January 1998

20 February 1998

23 February 1998

26 February 1998

2 March 1998

16 March 1998

3 April 1998

20 April 1998

10 May 1998

28 May 1998

29 May 1998

31 May 1998

2 June 1998

3 June 1998

17 June 1998

1 July 1998

7 July 1998

12 July 1998

23 August 1998

20 September 1998

18 October 1998

1 November 1998

15 November 1998

18 November 1998

19 November 1998

21 November 1998

21 November 1998

23 November 1998

7 December 1998

10 December 1998

20 January 1999

22 February 1999

13 May 1999

19 May 1999

20 May 1999

1 June 1999

7 June 1999

10 June 1999

11 June 1999

29 June 1999

2 July 1999

5 July 1999

6 July 1999

9 July 1999

16 July 1999

28 July 1999

1 August 1999

4 August 1999

16 August 1999

25 August 1999

27 September 1999

20 October 1999

21 October 1999

30 October 1999

6 November 1999

20 November 1999

27 December 1999

30 December 1999

15 March 2000

30 April 2000

12 May 2000

17 May 2000

23 January 2001

8 February 2001

18 February 2001

21 February 2001

24 February 2001

27 February 2001

13 April 2001

20 April 2001

21 May 2001

15 May 2002

5 June 2002

4 July 2002

18 August 2002

24 August 2002

26 August 2002

4 September 2002

5 September 2002

18 September 2002

26 September 2002

14 June 2003

5 August 2003

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/todo.html0000644000175000017500000011654710656147112016601 0ustar serge2serge2 Pmw todo list

Pmw todo list

This is a long list of suggestions and enhancements for Pmw. If you are interested in doing any of these, please let the Pmw maintainer (gregm@iname.com) know.

New Pmw megawidgets

Changes to current megawidgets

MegaToplevel

Dialog

ButtonBox

ComboBox

Counter

Arrowed megawidgets (Counter, ComboBox, TimeCounter)

EntryField

LabeledWidget

MenuBar

Balloon

MessageBar

NoteBook

OptionMenu

PanedWidget

RadioSelect

LogicalFont

Scrolled widgets

Miscellaneous

Documentation

Demos

Tests

Ideas

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/bugs.html0000644000175000017500000003301110656147112016554 0ustar serge2serge2 List of known bugs

List of known bugs

This is a list of some of the known bugs in Pmw. If you fix any of these, please let the maintainer (gregm@iname.com) know.

 import Tkinter
 import Pmw
 
 def foo(event):
     print '<Enter> event on text'
 
 root = Pmw.initialise()
 balloon = Pmw.Balloon()
 
 canvas = Tkinter.Canvas()
 canvas.pack()
 
 text1 = canvas.create_text(50, 50, text = 'hello
there')
 
 # As is, the balloon does not appear over the text, but foo
 # is called.  Swap the following two lines and the balloon
 # appears but foo will not be called.
 canvas.tag_bind(text1, "<Enter>", foo)
 balloon.tagbind(canvas, text1, 'text 1 help')
 
 root.mainloop()

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/copyright.html0000644000175000017500000000362610656147112017635 0ustar serge2serge2 Pmw copyright

Pmw copyright

Copyright 1997-1999 Telstra Corporation Limited, Australia Copyright 2000-2002 Really Good Software Pty Ltd, Australia

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/index.html0000644000175000017500000000760010656147112016730 0ustar serge2serge2 Pmw megawidgets 1.3

Pmw 1.3

Python megawidgets

Pmw is a toolkit for building high-level compound widgets in Python using the Tkinter module.

It consists of a set of base classes and a library of flexible and extensible megawidgets built on this foundation. These megawidgets include notebooks, comboboxes, selection widgets, paned widgets, scrolled widgets, dialog windows, etc.

Local documentation

Main features
Getting started - including downloading and installation
How to use Pmw megawidgets - creating and configuring megawidgets
How to build Pmw megawidgets - inheriting (sub-classing) from Pmw megawidgets
Demonstrations and tests - how to run
Dynamic loader - also discusses how to "freeze" Pmw
Reference manuals - complete documentation of all Pmw classes and functions
Porting between different versions of Pmw
Change log
Todo list and list of known bugs
Copyright

External links

Pmw project home page on SourceForge - contains CVS source repository, bug tracking, release distributions, mailing list, etc
Pmw-general mailing list - subscribe to this list to get announcements of Pmw releases and general discussion on Pmw
A User's Guide to Pmw.Blt - an excellent tutorial and reference covering the Pmw interface to the powerful Blt graph widget, written by Bjrn Ove Thue and Hans Petter Langtangen. You can also download the full HTML document for local viewing.

See the Pmw megawidgets home page for the latest information about Pmw.

Comments, bugs, fixes to the Pmw discussion and announcement mailing list.

Pmw 1.3 - 7 Aug 2007

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/starting.html0000644000175000017500000003001010656147112017443 0ustar serge2serge2 Getting started with Pmw

Getting started with Pmw

Introduction

This document describes how to fetch and install Pmw, and how to run the demonstrations and tests.

Requirements

Pmw.1.3 requires the _tkinter and Tkinter modules. It works with python versions 1.5.2 and greater (tested up to 2.2.1) and Tk versions 8.0 and greater (tested up to 8.3.2).

If the BLT extension to Tk is present, Pmw will use the BLT busy command during modal dialogs to display a clock cursor. Also, the Pmw.Blt interface to the BLT busy, graph, stripchart, tabset and vector commands will be available. BLT versions 2.4i and greater are supported (tested up to 2.4u). You can find BLT at http://www.tcltk.com/blt/.

Distribution and installation

Releases of the Pmw distribution are available via http from http://download.sourceforge.net/pmw/. This release is available as Pmw.1.3.tar.gz, released on 7 August 2007. This is a compressed tar file.
Under Linux, Unix, etc, you will need to unpack it using tar and you may also need to use gzip or gunzip to uncompress it.
Under Microsoft Windows, you will need a program such as WinZip (http://www.winzip.com) that can unpack the gzipped tar files. You may need to change the suffix of the file to .tgz for WinZip to recognise it.

This will unpack into a directory named src containing the directory Pmw and the installation utility setup.py. You now need to put this directory Pmw somewhere python can find it, preferably in one of the standard places, such as in the site-packages directory (eg: /usr/lib/python2.2/site-packages/Pmw) or the sys.prefix directory (eg: C:\Program Files\Python\Pmw or /usr/lib/python2.2).

One easy way to install the Pmw directory in the site-packages directory of your installation is to use the setup.py utility.

This is done as follows:

python setup.py install (as root)

or

sudo python setup.py install (under Ubuntu or Mac OS X)

Alternatively, to install manually, for example under Unix, assuming you have placed the tar file in the /tmp directory, you can simply run the following commands:

cd /usr/lib/python2.2/site-packages
gunzip /tmp/Pmw.1.3.tar.gz (or gzip -d /tmp/Pmw.1.3.tar.gz)
tar xvf /tmp/Pmw.1.3.tar

If you do not have write permission for these standard directories, place the Pmw directory somewhere on your PYTHONPATH or sys.path. If this is not possible, place the Pmw directory somewhere else and add the parent directory to your PYTHONPATH or sys.path.

If you have previously installed Pmw version 0.6 or later, then the new version can share the same Pmw directory as the previous versions. You will need to perform the tar extraction in the directory containing (that is, the parent directory of) the existing Pmw directory. By default, your applications will use the most recent version of Pmw. If required, the function Pmw.setversion() can be used to specify a version to be used. See the reference manual for details. If you are no longer using the older versions, you can safely remove the corresponding subdirectories from the Pmw directory.

If you need assistance in installing BLT under Unix, please contact me (gregm@iname.com) and I will try to help. For other operating systems, such as Microsoft or Macintosh, you should try asking the python newsgroup. If anyone can give me a description of how to install BLT under other operating systems please contribute it and I will place it here.

Documentation

The doc directory for each Pmw version contains all the documentation for that version of Pmw. See the local home page for a complete list of documents. The files in this directory are also available from the official Pmw home page.

An excellent tutorial and reference covering the Pmw interface to the powerful Blt graph widget, "A User's Guide to Pmw.Blt" written by Bjrn Ove Thue and Hans Petter Langtangen, is available. You can also download the full HTML document for local viewing.

Demonstrations and tests

A good way to get an overview of the functionality provided by Pmw is to run the demonstrations and tests and look at the demonstration code. To view a comprehensive demonstration of many of the features of Pmw run the All.py script, which can be found in the demos subdirectory of each version of Pmw.

You do not have to install Pmw to run the demonstrations and tests, simply change into the appropriate directory and run the file All.py. See Demonstrations and tests for more information about running the demonstrations and tests and how to create your own.

Note that there are some bugs in later versions of BLT (at least 2.4t and 2.4u) which cause some tests of Pmw.Blt.Graph to crash with python2.0 under Linux. These tests have been commented out (until BLT is fixed).

Contributions welcome

If you create some whiz-bang megawidgets and would like to contribute them to Pmw, they will be most welcome. You should be able to get some idea of the coding style used in Pmw code by reading How to build Pmw megawidgets and by looking at the Pmw library code itself in the lib directory of each Pmw version.

If you would like to contribute a megawidget, it would be preferable if it also came with a simple demonstration and a test script. See Demonstrations and tests for information about how to create new demonstrations and tests.

Each megawidget should also have a reference manual describing its options, components and methods.

Generating the documentation

The released reference manuals are automatically generated by merging specially marked-up text with the output from megawidget query methods, such as components(), options() and componentaliases(), and various other introspective devices. If you are interested to see how the documentation is generated, you can fetch the marked-up text and the python script to convert the text to html from http://download.sourceforge.net/pmw/Pmw.1.3.docsrc.tar.gz . Download this file into the Pmw/Pmw_1_3 directory of the Pmw source tree. Unzip and untar the file. This will create a docsrc sub-directory of Pmw/Pmw_1_3. If you want to keep the documentation which came with the Pmw distribution, rename the old doc directory. Then change directory to docsrc and run createmanuals.py. After printing lots of warnings about documentation that has not been written yet, this will create a new doc directory containing all the html documentation.

Here is an example set of commands to unpack the documentation source and regenerate the documentation, assuming you have downloaded the source in the Pmw/Pmw_1_3 directory:

cd Pmw/Pmw_1_3
gunzip Pmw.1.3.docsrc.tar.gz
tar xvf Pmw.1.3.docsrc.tar
mv doc doc.old
cd docsrc
./createmanuals.py

If running under Unix, you will need to run the createmanuals.py script with a valid DISPLAY environment variable, since it creates each megawidget and then queries it for its options, components, etc. This is because Tk (and hence Tkinter) requires a connection to an X server to run.

Future plans and bugs

The todo list contains a long list of of suggestions, bugs and enhancements for Pmw. If you are interested in doing any of these, please let the maintainer (gregm@iname.com) know. Some of the items in the todo list may be considered bugs. There are also some other problems due to idiosyncrasies in the implementation of Tk.

Licence

The official Pmw licence (see copyright) basically lets you do anything with Pmw as long as you don't hurt anyone. There is also another licence, the "Postcard Licence":

"I'd like to get a postcard from you! I'm interested in who is using Pmw, where you live and where in the world Pmw is doing it's job"

Please send me an e-mail to gregm@iname.com to get my postal address.

Acknowledgements

The initial ideas for Pmw were blatantly stolen from the itcl extensions [incr Tk] by Michael McLennan and [incr Widgets] by Mark Ulferts. Several of the megawidgets are direct translations from the itcl to python.

The base classes and most megawidgets were written by Greg McFarlane and Peter Munnings. Contributed megawidgets include: Pmw.TimeCounter by Joe VanAndel, Pmw.Group and an early version of Pmw.NoteBook by Case Roole, Pmw.ScrolledCanvas, Pmw.ScrolledFrame and another early version of Pmw.NoteBook by Joe Saltiel and Pmw.OptionMenu by Roman Sulzhyk. A big thank you to the following people for their bug reports, fixes, enhancements and suggestions: David Ascher, Robin Becker, Siggy Brentrup, Mark Colclough, Jerome Gay, Clemens Hintze, Rob Hooft Jack Jansen, Jonathan Kelly, Magnus Kessler, Matthias Klose, Andreas Kostyrka, Fredrik Lundh, Magnus Lycka, Graham Matthews, Dieter Maurer, Michael McLay, Daniel Michelson, Georg Mischler, Rob Pearson, Case Roole, Joe Saltiel, Roman Sulzhyk, Shen Wang, Chris Wright, and Guido van Rossum. Special thanks to Case Roole and Michael McLay for help with getting Pmw to work with python packages and many other nifty features. My deepest apologies if I have forgotten anyone. Please let me know.

The Pmw home page and project site is made available courtesy of SourceForge.

The current maintainer is Greg McFarlane. I monitor the Pmw discussion and announcement mailing list so please send any problems, comments, suggestions or enhancements to the list. You may also contact me directly at gregm@iname.com.

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/demosandtests.html0000644000175000017500000002341110656147112020474 0ustar serge2serge2 Pmw demonstrations and tests

Pmw demonstrations and tests

Pmw comes with an extensive range of demonstrations and tests. The demonstrations can be used to get a feel for what is provided by Pmw and the demonstration code can be viewed to see examples of how to use Pmw. The tests can be executed to check that there are no problems with running Pmw in your environment.

Demonstrations

The Pmw demos directory contains demonstration scripts showing many of the features of Pmw megawidgets. To view a comprehensive package of all the demonstrations, including a view of the source code, run the All.py script. Run All.py -help for a short description of the script's options.

All of the demonstrations may also be run separately. Most of the demonstrations show some of the features of one of the Pmw megawidgets. For example, to see a demonstration of the ButtonBox megawidget, change into the demos directory and run

python ButtonBox.py

Other demonstrations, which show other features of Pmw include

BltGraph.py         demonstrates the Pmw interface to
                    the BLT graph and vector commands
BltTabset.py        demonstrates the Pmw interface to
                    the BLT tabset command
Colors.py           how to set color schemes
ConfigClass.py      how to configure the python class
                    of a megawidger component
ErrorHandling.py    how Pmw displays run time errors
                    in a window
ExampleDemo.py      template for new demonstrations
Grid.py             the Tkinter Grid geometry manager
LogicalFont.py      how to use standard values for fonts
MessageInfo.py      how to extend the Pmw MegaToplevel
                    class
NestedDialogs.py    how nested modal dialogs behave
Resources.py        how to use the option database to
                    modify Tk widget option defaults
Resources_Pmw.py    how to use the option database to
                    modify megawidget option defaults
ShowBusy.py         demonstrates the Pmw interface to
                    the BLT busy command
SpecialEntry.py     deriving from Pmw.EntryField
Spectrum.py         some of the Pmw color handling
                    functions
SpeedTest.py        tests the speed of creating Pmw
                    megawidgets
TextDisplay.py      how to extend the Pmw MegaWidget
                    class
WidgetDestroy.py    megawidget destruction
Creating demonstrations of new megawidgets

If you create a new megawidget you can create a demonstration for it by using the file ExampleDemo.py as a template. This template allows the demonstration to be run individually or to be automatically included as part of the demonstration package All.py. You should take a copy of the template and name the new file after your megawidget. You should then replace each instance of the word EXAMPLE with the name of your megawidget and replace the code in the __init__ method with code to create and initialise one or more instances of your megawidget, which should be a child of parent. You can add other methods as necessary.

Tests

The Pmw tests directory contains a test framework and a set of test scripts for Pmw. The tests cover the standard Tkinter module and most of the Pmw megawidgets. The tests make a great demonstration of the flexibility of the megawidgets. Simply change into the tests directory and run python All.py.

If all tests pass there should be no output printed to standard output. If any of the tests fail, please send the test output to the maintainer at gregm@iname.com.

All of the tests may be run separately. Most of the tests test the features of one of the Pmw megawidgets. For example, to execute the test for the ButtonBox megawidget, run

python ButtonBox_test.py

The Test.py file contains general testing functions and is imported by all test files. Other files, which test other features of Pmw include

Blt_test.py           BLT vector and graph interface
Colors_test.py        setting color schemes
MegaWidget_test.py    creation of megawidget classes
Options_test.py       option and component handling
PmwBase_test.py       more option and component handling
Tkinter_test.py       Tk widgets in the Tkinter module
Creating tests for new megawidgets

If you create a new megawidget you should create a test for it. There is no template file for creating tests, but by looking at the other Pmw tests (for example, ScrolledText_test.py) you will get some idea of how to create a test for your megawidget.

The test files are designed to be run both individually or automatically by the test package All.py. Each test file must define the testData tuple. This consists of a sequence of 2-element tuples, each tuple being a test specification for one megawidget. Usually a file tests only one megawidget and so there is only one test specification. The first element in the specification is the megawidget class and the second is a sequence of (yet more) 2-element tuples. In each of these tuples, the first element is a sequence of individual tests to perform on an instance of the megawidget and the second element is a dictionary to use for the keyword arguments when creating the instance. Each individual test is a tuple, the meaning of which depends on the type of the first element, which may be either a string, a function or a method of the megawidget class, as explained below.

Some special functions and values supplied by the Test module that may be used in the tests include:

Test.callback       callback taking no arguments
Test.callback1      callback taking one argument
Test.callbackN      callback taking any number of arguments

Test.currentWidget  returns the widget instance being tested
Test.num_options    returns number of options for the widget

Test.earthris       a sample Tkinter.PhotoImage
Test.flagup         a sample Tkinter.BitmapImage
Test.floatvar       a Tkinter.DoubleVar
Test.stringvar      a Tkinter.StringVar

To slow down a test (to see what is being displayed), add the following line which sets the delay between tests to (say) 1000 milliseconds:

Test.setdelay(1000)

To print information about what is being tested, add the line:

Test.setverbose(1)

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/howtobuild.html0000644000175000017500000003273410656147112020007 0ustar serge2serge2 How to build Pmw megawidgets

How to build Pmw megawidgets

Introduction

This document briefly describes how to design and code Pmw megawidgets by inheriting from the Pmw base classes. It shows step by step how to build a simple example megawidget. This megawidget allows the user to select one of a range of numbers and it also indicates if the selected number is greater than a given threshold.

Choosing the components

The megawidget will be built using a Tkinter.Scale widget to allow the user to select a number in a range, and a Tkinter.Frame widget to act as an indicator, displaying red (say) if the selected number exceeds the threshold. It will look something like this:

Scale 2

The programmer using this megawidget will need access to the scale widget, since they will need to set the scale's range. Therefore the scale will be made a component of the megawidget. The programmer will probably not need access to the indicator frame, but, just in case the need arises to change the borderwidth or relief of the indicator, we will make it a component too. This illustrates a convention about components - for maximum configurability, make all sub-widgets components.

Choosing the options

Apart from the component options now available through the scale and indicator components, the megawidget will need a few options of its own. It will need a threshold option to set the threshold. It may also need options to set the colors of the indicator when the selected value is both above and below the threshold. Other options could be orient or indicatorpos to specify the relative position of components and margin, padx or pady to specify spacing between and around the components. For this example, we will define three options - threshold, colors and value. The colors option will be a 2-element sequence specifying two colors (below threshold, above threshold). The value option will be the initial value of the scale.

Coding the megawidget

The first things to do are to decide on a name for the new megawidget, decide which base class to inherit from and to begin to write the constructor. Most Pmw megawidgets are derived from either Pmw.MegaWidget, Pmw.MegaToplevel or Pmw.Dialog. In this case, since the widget is not to be contained within its own toplevel window, we will inherit from Pmw.MegaWidget. The constructors of megawidgets take one argument (the widget to use as the parent of the megawidget's hull, defaulting to the root window) and any number of keyword arguments.

class ThresholdScale(Pmw.MegaWidget):
    """ Megawidget containing a scale and an indicator.
    """
 
    def __init__(self, parent = None, **kw):

Next, we need to define the options supplied by this megawidget. Each option is specified by a 3-element sequence. The first element is the option's name. The second element is the default value. The third element is either a callback function, Pmw.INITOPT or None. In the first case, the function is called at the end of construction (during the call to self.inialiseoptions) and also whenever the option is set by a call to configure. Pmw.INITOPT indicates that the option is an initialisation option - it cannot be set by calling configure. None indicates that the option can be set by calling configure, but that there is no callback function.

The call to self.defineoptions also includes the keyword arguments passed in to the constructor. The value given to any option specified in the keywords will override the default value.

        # Define the megawidget options.
        optiondefs = (
            ('colors',    ('green', 'red'), None),
            ('threshold', 50,               None),
            ('value',     None,             Pmw.INITOPT),
        )
        self.defineoptions(kw, optiondefs)

After defining the options, the constructor of the base class should be called. The options need to be defined first so that a derived class can redefine the default value of an option defined in a base class. This is because the value specified by the derived class must be made available before the base class constructor is called. The keyword arguments should not be passed into the base class constructor since they have already been dealt with in the previous step.

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

Now we should create the components. The components are created as children (or grandchildren ...) of the megawidget's interior.

        # Create the components.
        interior = self.interior()

The first component to create is the indicator. The createcomponent method creates the sub-widget and registers the widget as a component of this megawidget. It takes five arguments plus any number of keyword arguments. The arguments are name, aliases, group, class and constructor arguments. See the Pmw.MegaArchetype reference manual) for full details.

        # Create the indicator component.
        self.indicator = self.createcomponent('indicator',
                (), None,
                Tkinter.Frame, (interior,),
                        width = 16,
                        height = 16,
                        borderwidth = 2,
                        relief = 'raised')
        self.indicator.grid()

The scale component is created in a similar way. In this case, the initial value of the scale is also set to the value of the value initialisation option.

        # Create the scale component.
        self.scale = self.createcomponent('scale',
                (), None,
                Tkinter.Scale, (interior,),
                        command = self._doCommand,
                        tickinterval = 20,
                        length = 200,
                        from_ = 100,
                        to = 0,
                        showvalue = 0)
        self.scale.grid()
 
        value = self['value']
        if value is not None:
            self.scale.set(value)

At the end of the constructor, the initialiseoptions method is called to check that all keyword arguments have been used (that is, the caller did not specify any unknown or misspelled options) and to call the option callback functions.

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

All other methods must now be defined. In this case, only one method is required - a method called whenever the scale changes and which sets the indicator color according to the threshold.

    def _doCommand(self, valueStr):
        if self.scale.get() > self['threshold']:
            color = self['colors'][1]
        else:
            color = self['colors'][0]
        self.indicator.configure(background = color)

To complete the megawidget, methods from other classes can be copied into this class. In this case, all Tkinter.Scale methods not already defined by the megawidget are made available as methods of this class and are forwarded to the scale component. Note that the third argument to Pmw.forwardmethods is the name of the instance variable referring to the Tkinter.Scale widget and not the name of the component. This function is called outside of and after the class definition.

Pmw.forwardmethods(ThresholdScale, Tkinter.Scale, 'scale')

Important note: If a megawidget defines options using defineoptions(), then this method must be called in the megawidget constructor before the call to the base class constructor and a matching call to initialiseoptions() must made at the end of the constructor. For example:

    def __init__(self, parent = None, **kw):
	optionDefs = ...
	self.defineoptions(kw, optionDefs)
	BaseClass.__init__(self, parent)
	...
	self.initialiseoptions()

Creating instances of the megawidget

The code below creates two of our example megawidgets. The first is created with default values for all options. The second is created with new values for the options. It also redefines some of the options of the components.

# Create and pack two ThresholdScale megawidgets.
mega1 = ThresholdScale()
mega1.pack(side = 'left', padx = 10, pady = 10)

mega2 = ThresholdScale(
        colors = ('green', 'yellow'),
        threshold = 75,
        value = 80,
        indicator_width = 32,
        scale_width = 25)
mega2.pack(side = 'left', padx = 10, pady = 10)

Scale 1

The complete code

The complete code for this example can be seen here.

Exercises

These exercises build on the example presented so far.

  1. Change the call to create mega1 so that the scale widget displays the current value next to the slider. (You may need to look at the Tk scale manual page to find which option to the scale component to set.) You will be able to do this without modifying the ThresholdScale class code.
  2. Add a Tkinter.Label component between the indicator and scale components. Modify the _doCommand method so that it displays the current value of the scale in this label.
  3. Modify the colors and threshold options so that they both accept a tuple. Now implement multiple thresholds, so that the indicator displays one of several colors, depending on the value of the scale.
  4. Add an orient initialisation option and lay out the components horizontally or vertically depending on its value.
  5. Read the description of the createlabel() method in the Pmw.MegaArchetype reference manual and add labelpos and labelmargin initialisation options which allow the creation of a label for the megawidget.

An example of how these changes can be made can be seen here.

Contributing your megawidgets to Pmw

If you have completed a megawidget that may be useful to others, you may like to consider contributing it to Pmw. See Contributions welcome for how to contribute.

Pmw coding conventions

As a final note, the Pmw code makes an attempt to follow these coding conventions.

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/dynamicloader.html0000644000175000017500000001605310656147112020436 0ustar serge2serge2 Dynamic loader

Dynamic loader

There are two aspects of Pmw, unrelated to megawidgets, that require special attention. Firstly, Pmw is made up of many sub-modules, potentially making access to its various classes and functions cumbersome for the user. Secondly, Pmw is regularly being modified and added to, thus requiring the release of new versions. Therefore, techniques for making access to the sub-modules easy and efficient and for dealing with the different versions have been developed. These techniques are incorporated into the dynamic loader which Pmw creates when it is first imported.

The first purpose of the loader is to give access to all Pmw classes and functions through a single entry point, the Pmw. prefix. For example, to access the ComboBox class (which resides in one of the sub-modules of Pmw), you just have to use Pmw.ComboBox. Without the loader, this would be a more complicated reference, such as, hypothetically, Pmw.PmwComboBox.ComboBox.

The second purpose of the loader is to delay the importing of the sub-modules until they are needed. This improves the startup time of applications which only use a few Pmw megawidgets. It also allows more megawidgets to be added to the library without slowing down applications which do not use them.

The third purpose of the loader is to allow a script using Pmw to specify which version of Pmw it requires. This allows an application to continue working correctly even after newer releases of Pmw have been made which are not compatible with the version expected by the application. Several versions of Pmw can be installed at once, with the actual version used being specified by each application. In addition, the loader can be configured to search in one or more alpha versions of Pmw. These versions may contain new megawidgets, or new versions of existing megawidgets, that are currently not in the base releases.

Several functions are available to set and query the version of Pmw being used. These are Pmw.setversion() and Pmw.setalphaversions() which specify the version and alpha versions (if any) to use for this session; Pmw.version() which returns the version(s) being used by this session; and Pmw.installedversions() which returns the version(s) of Pmw currently installed. These are described in the Pmw functions reference manual.

When Pmw is first imported, an instance of PmwLoader is created and placed into sys.modules['Pmw']. From that point on, any reference to attributes of the Pmw 'module' is handled by the loader. The real Pmw package is stored in sys.modules['_Pmw'].

The loader searches the Pmw package base directory for sub-directories with the prefixes Pmw_ and Alpha_, which contain Pmw base releases and alpha releases. The version numbers are given by the part of the directory name following the prefix. These versions are available for use and are those returned by the Pmw.installedversions function. The initial version is set to the base release with the greatest version number. When the first reference to a Pmw class or function is made, the loader reads the files named Pmw.def in the current base version directory and also in the alpha directories (if any). These files list all the classes and functions supported by the version. Pmw attributes are first searched for in the alpha directories and then in the base version directory. The first directory which supports the reference is used. In this way, alpha versions override base versions.

The directory Alpha_99_9_example contains a simple example of how to structure an alpha version. The following code can be used to request that the alpha version be used and then creates an instance of a new megawidget defined in the alpha version.

 import Pmw
 Pmw.setalphaversions('99.9.example')

 # Create a standard message dialog using the base Pmw version.
 ordinary = Pmw.MessageDialog(
     message_text = 'Ordinary\nPmw Dialog')

 # Create an example dialog using the alpha Pmw version.
 alpha = Pmw.AlphaExample()

Freezing Pmw

Since the dynamic loader requires that Pmw be installed at run time, it can not be used when freezing Pmw. In this case, a single module containing all Pmw code is required, which can then be frozen with the rest of the application's modules. The bundlepmw.py script in the Pmw bin directory can be used to create such a file. This script concatenates (almost) all Pmw megawidget files into a single file, Pmw.py, which it writes to the current directory. The script is called like this:

 bundlepmw.py [-noblt] [-nocolor] /path/to/Pmw/Pmw_X_X_X/lib

The last argument should be the path to the lib directory of the required version of Pmw. By default, the Pmw.py file imports the PmwBlt and PmwColor modules and so, to freeze an application using Pmw, you will need to copy the files PmwBlt.py and PmwColor.py to the application directory before freezing.

If you are sure that your application does not use any of the Pmw.Blt or Pmw.Color functions, you can use the -noblt or -nocolor options. In this case Pmw.py will be modified so that it does not import these module(s) and so will not need to be included when freezing the application.

If your application only uses a few Pmw megawidgets, you can remove the references to the usused ones in the files list in the bundlepmw.py code. To make the change, take a copy of the script and modify it. This will make the Pmw.py file smaller. However, be sure that you do not delete megawidgets that are components or base classes of megawidgets that you use.

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/porting.html0000644000175000017500000002712310656147112017305 0ustar serge2serge2 Porting between different versions of Pmw

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 1.2 to 1.3:

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.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/howtouse.html0000644000175000017500000004362210656147112017502 0ustar serge2serge2 How to use Pmw megawidgets

How to use Pmw megawidgets

Introduction

This document briefly describes the features of the Pmw megawidget toolkit and how to use the megawidgets. Using examples, it describes those features common to all Pmw megawidgets. For a description of individual Pmw megawidgets see the reference manuals. For complete information on general Pmw megawidget functionality see the Pmw.MegaArchetype reference manual. For a lot more example code, run any of the files in the Pmw demos directory.

A simple example of a megawidget is a counter. This widget contains an entry field and two small arrow buttons. Users may enter a value directly into the entry field or they may use the buttons to increment and decrement the value displayed without having to use the keyboard. Having this and other megawidgets in your toolbox allows you to choose the best graphical interface for your application.

Getting started

Initialisation of Pmw

To run the examples in the tutorial, make sure that the Pmw lib directory is in sys.path. You should be able to cut and paste the examples into an interactive python session, or you can copy them to a file and run the file with python.

The following two lines should be entered before any of the examples. These import and initialise Pmw. For more information on Pmw.initialise() see the Pmw functions reference manual.

import Pmw
root = Pmw.initialise()

If necessary, you can have more control over how Tkinter and Pmw are initialised by using this form of initialisation:

import Tkinter
root = Tkinter.Tk()
import Pmw
Pmw.initialise(root)

Megawidget construction

Creating a counter

Now that you have the formalities out of the way, you can create and pack a counter megawidget (see Pmw.Counter reference manual) using its default configuration like this:

counter1 = Pmw.Counter()
counter1.pack(padx = 10, pady = 10)

Now enter a number and click on the arrow buttons to see the number increment or decrement. The result looks something like this:

Counter 1

The above example creates the counter as a child of the root window. If you want to create it as a child of another window (for example, a Tkinter.Frame widget called 'frame'), add the parent as an argument to the constructor:

counter1a = Pmw.Counter(frame)

Methods

Once a megawidget has been created, you can call any of its other methods in a similar way to Tk widgets. The following sets the value of the counter and then increments it:

counter1.setentry(41)
counter1.increment()

Options

Like any widget, a megawidget may have options to allow it to be configured for a particular use. Options allow the megawidget user to modify the appearance and behaviour of the megawidget. The counter megawidget has several such options. One of them, datatype, specifies how the counter should count up and down, such as, for example, by integers, reals, times or dates. The default value is 'numeric', which means the counter expects integers to be entered and will support incrementing and decrementing by whole numbers.

Another option is increment, which specifies how many units should be added or subtracted when the counter is incremented or decremented. Using these options, you can create a time counter, supporting the format HH:MM:SS, and counting in minutes, like this (note also the call to the setentry method to set the contents of the entry field):

counter2 = Pmw.Counter(
    datatype = 'time',
    increment = 60)
counter2.setentry('00:00:00')
counter2.pack(padx = 10, pady = 10)

Many megawidget options can be modified using the configure() method. For example, you can change the value of the increment option to 10 minutes like this:

counter2.configure(increment = 60 * 10)
Initialisation options

Some megawidget options can only be set when creating the megawidget. These options can not be set by calling the configure() method, but they can be queried in all the usual ways. For example, the counter has an orient initialisation option which specifies whether the arrow buttons should appear to the left and right of the entry field ('horizontal') or above and below ('vertical'). You can create a numeric counter with arrow buttons above and below the entry field like this:

counter3 = Pmw.Counter(orient = 'vertical')
counter3.pack(padx = 10, pady = 10)
Querying options

You can query the value of megawidget options (initialisation or not) in similar ways as for normal Tkinter widgets. For example, the following code prints the values of some of the counter options.

print counter3.cget('increment')
    --> 1
print counter3.configure('orient')
    --> ('orient', 'orient', 'Orient', 'horizontal', 'vertical')

When a Tk widget option is queried, its value is always returned as a string, regardless of the type used when setting the option. However, when a Pmw megawidget option is queried, a reference to the object used when setting the option is returned. In other words it is not always a string. For example, the type returned by cget('increment') above was integer.

Components

Megawidgets are made up of other widgets, which we call components. Each component is known by a logical name and may be either a simple Tk widget, or may itself be a megawidget. Pmw gives the megawidget user access to not only the functionality supported directly by the megawidget through its options and methods, but also to the components of the megawidget and their options and methods. To access a component directly, use the component() method. For example, to call method doit of component comp of megawidget mega:

mega.component('comp').doit()
Component options

There is a short-hand way to access the options of components, by using the notation component_option. This allows, for example, a counter megawidget to be configured with different colored backgrounds for each of its arrow button components (these components are called downarrow and uparrow):

counter2.configure(
    downarrow_background = 'green',
    uparrow_background = 'red')
The hull

All megawidgets are enclosed in a containing widget which is created automatically by the Pmw base classes. For normal megawidgets the container is a Tkinter Frame widget. For megawidgets which are toplevel windows, the container is a Tkinter Toplevel widget. The containing widget is accessible as the hull component.

To access options of the containing widget use the form hull_option. For example to create a counter megawidget with a wide sunken border around it:

counter4 = Pmw.Counter(
    hull_relief = 'sunken',
    hull_borderwidth = 5 
)
The interior

Some megawidgets, such as Dialog and LabeledWidget, also have a frame into which users can pack other widgets. This frame may be a component but can also be accessed with the interior() method. For the Pmw.MegaToplevel and Pmw.MegaWidget classes, the interior widget is the same as the hull widget. For other megawidgets, the hull is the outer, containing widget and the interior is the empty frame which can be used to extend the megawidget by including extra internal widgets.

Sub components and aliases

Components may themselves be megawidgets and so their (sub-)components can be referred to using the notation component_sub-component. For example, the entryfield component of the counter is a Pmw.EntryField megawidget (which handles the input validation). In turn, this has a Tkinter.Entry component named entry. Therefore, you can change the background of the counter's Tkinter.Entry widget with:

counter2.configure(entryfield_entry_background = 'yellow')

Most component path names (like entryfield_entry) have a shorter alias defined for them. In this case, you can use the equivalent:

counter2.configure(entry_background = 'yellow')
Changing the python class of a component

Each megawidget component is an instance of some python class. The default class of each component is given in the reference manual. By using the special pyclass component option, you can specify a different python class to use when creating the component. For example, to create a Pmw.Counter megawidget which has a Tkinter.Button as its label, rather than the default Tkinter.Label:

counter5 = Pmw.Counter(
        labelpos = 'w',
        label_text = 'Hello',
        label_pyclass = Tkinter.Button
)

Forwarding methods

Since a Pmw megawidget is a normal python class, it both inherits methods from its base classes and also may have other methods defined for it in the usual way. Pmw also supports a third way that a megawidget may gain methods - by 'forwarding' methods to one or more of its subwidgets. This is also known as 'delegating'. For example, a Pmw.Counter megawidget delegates the methods related to its Pmw.EntryField component, entryfield, to the component. It does not have to explicitely define methods which call the component methods. This is why we can call counter2.setentry() - since setentry() is a method of the Pmw.EntryField component, it is available to the Pmw.Counter.

Methods already defined by a class or its base classes take precedence over delegated methods. For example, Pmw.Counter inherits a cget method from Pmw.MegaArchetype. Therefore, this method is not delegated to the cget method of Pmw.EntryField.

Extending Pmw megawidgets

There are several ways of extending Pmw megawidgets. Firstly, the flexibility of the options and components allows the widget's appearance and behaviour to be greatly modified. Secondly, widgets of the user's choice can be added inside some megawidgets by using the interior() method. The Pmw classes MegaToplevel, MegaWidget, Dialog and LabeledWidget are particularly designed to be extended in this way. For example, to create a dialog window containing a counter:

dialog = Pmw.Dialog(
        title = 'Counter dialog',
        buttons = ('OK', 'Cancel'))
interior = dialog.interior()
counter = Pmw.Counter(interior)
counter.pack(padx = 20, pady = 20)

Counter 2

A third way to extend megawidgets is to inherit from (or subclass) them. See How to build Pmw megawidgets for information on how to use inheritance to extend a megawidget by adding new options. For simpler cases, where new methods are to be added to an existing megawidget and/or the default values for some options are to be changed, normal subclassing can be used. For example, to create new classes based on a Pmw.Counter, one with a new method getminutes() and one with a default datatype of 'time' and a white entry background:

class MinuteCounter1(Pmw.Counter):

    def getminutes(self):
	return Pmw.timestringtoseconds(self.getvalue()) / 60

class MinuteCounter2(Pmw.Counter):

    def __init__(self, parent = None, **kw):
        kw['datatype'] = 'time'
        kw['entry_background'] = 'white'
        kw['entryfield_value'] = '00:00:00'
        kw['increment'] = 60
	apply(Pmw.Counter.__init__, (self, parent), kw)

A quick example

The following code is a small example of how to use Pmw megawidgets. It is a complete program which displays three ways for the user to enter a value - using an up-down counter, an entry field with validation and a dropdown combobox.

import Pmw
root = Pmw.initialise(fontScheme = 'pmw1')

counter = Pmw.Counter(
        label_text = 'Counter:',
        labelpos = 'w',
        entryfield_value = '00:00:00',
        entryfield_validate = 'time',
        datatype='time',
        increment=5*60,
)
counter.pack(fill = 'x', padx = 10, pady = 10)

entry = Pmw.EntryField(
        label_text = 'Real entry:',
        labelpos = 'w',
        value = '+2.9979e+8',
        validate = 'real',
)
entry.pack(fill = 'x', padx = 10, pady = 10)

combo = Pmw.ComboBox(
        label_text = 'ComboBox:',
        labelpos = 'w',
        scrolledlist_items = map(str, range(20))
)
combo.pack(fill = 'x', padx = 10, pady = 10)

# Make the labels line up neatly
Pmw.alignlabels((counter, entry, combo))

root.title('Pmw megawidgets example')
root.mainloop()

Example 1

Another example

The following also shows how to use Pmw megawidgets. It displays a RadioSelect megawidget and an exit button packed into the root window.

import Tkinter
import Pmw

def callback(tag):
    # This is called whenever the user clicks on a
    # button in the RadioSelect widget.
    print tag, 'was pressed.'

# Initialise Tkinter and Pmw.
root = Pmw.initialise(fontScheme = 'pmw1')
root.title('Pmw RadioSelect demonstration')

# Create and pack a RadioSelect widget.
radio = Pmw.RadioSelect(
        command = callback,
        labelpos = 'w',
        label_text = 'Food group:')
radio.pack(padx = 20, pady = 20)

# Add some buttons to the RadioSelect.
for text in ('Fruit', 'Vegetables', 'Cereals', 'Legumes'):
    radio.add(text)
radio.invoke('Vegetables')

# Create an exit button.
exit = Tkinter.Button(text = 'Exit', command = root.destroy)
exit.pack(pady = 20)

# Let's go.
root.mainloop()

Example 2

Using the Tk option database

There are several ways to use the Tk option database to customise a Pmw application. Firstly you can customise all the basic Tk widgets in the usual way. For example, to set the background of all Tkinter.Label widgets (whether a megawidget component or not):

root.option_add('*Label.background', 'pink')

To set the background of all Pmw.EntryField label components:

root.option_add('*EntryField.Label.background', 'green')

To set the background of all Pmw.EntryField components, including the hull component:

root.option_add('*EntryField*background', 'blue')

The above option settings affect basic Tk widgets and, since it is built into the Tk widgets, this functionality is always available. However, to be able to use the Tk option database to set the default values for Pmw megawidget options, Pmw.initialise() must be called with useTkOptionDb = 1. If this is not done, Pmw does not query the Tk option database for megawidget option defaults. This is the default behaviour because there is a slight performance penalty for using the Tk option database.

Assuming useTkOptionDb has been set, the default buttonbox position of all Pmw.Dialog megawidgets can be changed with:

root.option_add('*Dialog.buttonboxpos', 'e')

To set the label position of all Pmw.EntryField megawidgets, thus giving them a label component by default:

root.option_add('*EntryField.labelpos', 'w')

Pmw 1.3 - 7 Aug 2007 - Home

Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/AboutDialog.gif0000644000175000017500000000776110656147112017624 0ustar serge2serge2GIF87az`w`0;,zh^.I8ͻ`("Dbylp,ZipH,Ȥrl:(ԗ)جvzpzUhznW~o2(tT 8&ďuͮԎғבƎȄʢ웷ﯵنд/>[xl]rAL4ED f80=eG0F4KrPP:d0s@ŗ 7߽yCE4i$*͞jqPJѦR*2lQWhPʺ*VeXZѹ`@s!ۖےj[dKPDOcm98Ü/*XK18Ec\A-Fj饘ftNjJ*ꨤejꪬꪩRꫴj뭀ƺ%hZ)k,z6hF+If&vp 6+n.+:K2jo,0lf kmG0Wg,/!qef¬fm,s+<+b<7t:s`~@'s/sxIsټ\<ۼ5S_0l2V%nKPCqM1ecu;ڃ -#Q3|4ߌڍk͈G9璇 Ԇw9̨On N脣-x퍧{ˎN9t]x屏 _+ݺ_s-^oOx͔g>Ӧ>?'O* (ZL`' f ̠0n A(Npo&La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w/Pmw_1_3/doc/MainMenuBar.gif0000644000175000017500000000100610656147112017552 0ustar serge2serge2GIF87aق,ڋ޼ ʶ rj{ Ģ"̦ )ԪMܮ l+v@>96c>߸1y׷0蠖PF(HaW#Xp A: z0Z i zJXkX'7|9II,1);Hm kL )}>p]z̜^{l5r;^*%N[0aPI 7,2dZć03wC1F"~4M%r/j)2YZ+J ./CTiP39* T>ArB]61rV>8BRWe<: `ͧX Qe,"/d i7({1d>- r{! ,gKR~ شkm;(w]Āċ?<̛;=ԫ[=ܻ{;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MenuBar.gif0000644000175000017500000000100610656147112016745 0ustar serge2serge2GIF87aق,ڋ޼ ʶ rj{ Ģ"̦ )ԪMܮ l+v@>96c>߸1y׷0蠖PF(HaW#Xp A: z0Z i zJXkX'7|9II,1);Hm kL )}>p]z̜^{l5r;^*%N[0aPI 7,2dZć03wC1F"~4M%r/j)2YZ+J ./CTiP39* T>ArB]61rV>8BRWe<: `ͧX Qe,"/d i7({1d>- r{! ,gKR~ شkm;(w]Āċ?<̛;=ԫ[=ܻ{;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MessageBar.gif0000644000175000017500000000066310656147112017435 0ustar serge2serge2GIF87a,ق,,ڋ޼H扦ʶ L ĢL*̦ JԪjܮ #N (8HXhx)9IYiy ə* T:Zqª*;jaK k{[̀1LzL=\L=]k\.,>ޮ1?O^m]vMJ8f1p0 A"B8j<d9sMR;M(kBQk-eLDTRIi4] SGZ15F֫\Cl}رd˚=6Z:U\z 7ܹtڽ;޽| 8 >8Ō;~ 9ɔ+w*;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/MessageDialog.gif0000644000175000017500000000645610656147112020136 0ustar serge2serge2GIF87a5`w`0;,5hN.I8ͻ`@Fel뾰qzix.|pH,Ȥrɴ2EsJZجvJQplL."E]}Ml|Nf|ؽS xx5$oÀǬɅφԇ›|׆㪭߸-7‡j9|nÈlMh 6 @O!` @A:V8S&2l. f?2 s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|=](6-~~IPE;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/TimeCounter.gif0000644000175000017500000000206510656147112017660 0ustar serge2serge2GIF87aUق,Uڋ޼H扦ʶn L p3 qʥM0,NZjmbcèG ʸ)~a39vC`A n/SyҶ&'"8wW88hШpɐp8xI Jbj*i٪@[r{{,Fbz;lll-9}R ^, %-nؾN~N;/} kn?!PD.p = #"ノy9&K;.Hly3T 4hD-NG:U4)ԨEu.ՠiūʕH5,PaU; ܟreV컮u 6/8#o;ػXq⿑Rp 9/kȓIO88cY ϖ6bڵkw,h}R;h6+` aoztDz~K.?sùa.!>ހ|g7wf{|QԷ]p~N|{|tnv)xoܧA~QH(b"n'^m e &`y>1v"' N؝e!w>8%z42xxH@9|?_0)Kf^eVg)':deF‰hD-[K:*i.zZE*:I)nf)6Ji |*hꤦZ"r wUJv,HRJy(zd:>K&8մ⚭.+4K.n3.߾9:ڮ;/L:ELDDTѽ0$@LAG1{+9rU$B %r<@+mY#\VPDoVFG'FqЏ% # i(Y-ݾb0UEAh_lK u$f'6{\u\.vW(^8aٽON9Z}_yoyl;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/blue_line.gif0000644000175000017500000000172510656147112017362 0ustar serge2serge2GIF87a@zsi~aw ±ꥮXkPdEZ=R;RҢꜥ北3G*?)?5,, “僌}s~kvitakXbP[EQ=I3=*5ꫫꥥ,@@ +eH8m5v+Xq8Kxu:D/HxL8H` f^*qp-NѣH[=%Z2qea^VPX@R6`i 5xtӃ7fYX- @o$aI%⹳aC/ <ԒK9qdʜI1[jFR0EsN:}TY-%'NQo)! f ±daM4h,GTQ j|C.Kw} >}wX@NA<]yD:MM3Z$ͳ hʪޜ;۞Pf[ȑ/?i!#sa]t01XZ#Bx` ULӠ$ah*8ѥG4B<ŁC#_N:4SӨI Th)TR;*e`Nv+XHVm2^V/Y7Ox^anJknرORyBY D=BӨ 2Q+S˞M^]৷;УKwسkνËOӫǑ;Pmw.1.3.2/src/Pmw/Pmw_1_3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: }SlqMh%pmbf"F&[=`HGBiUո&p%AZgyxPKds-J類b() sRhY꥾E)}"d&:)fJ*Rf鐫b-Wjhfcb j⪭mJabi$ꩵZ#N {eyVӞ9dV,2로F˰pa"my\OBs^ " lcv|crXk7[[/;1cb9(y^@T Pn XmLCsY t($ݗ=Ԯ`oҰ5ig@4'=B@T&=w< |wE&Sn",:>ِP``[H^ H@.tl? 4/?.',7?/=Togw/o觯/o HL:'H Z̠7z GH(L W0 gH8̡w@ E3b6=s]LESHQFT")*-b01Q?h=dl<#8ZQљ %xTxGUH9bUXHMYl)YkL$FLq "=ɎM\c #)CA2R+Y1r֨enhlD,/M s1Leol&"d7=nHӘ5nz 8IrL:v;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/halfblueball.gif0000644000175000017500000000045310656147112020036 0ustar serge2serge2GIF87a{Bxcv{j{j1{!v^h_YNIL=s0c!Jc;k-Z*J1`HsJw,P@pH,Ā`0p@$p< Gc (ʢX,LFsTl2G !"#}$!!$%mBA;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/scale1.gif0000644000175000017500000000177010656147112016574 0ustar serge2serge2GIF87aFÂ,FI8ͻ`(dihlp,t"x @ 0$v(DDMzEN[kכ_, O׺mie}JzvBL&{vŨqkf`ֻZڷ,޲')sNj !$@0 w`? adHqEnl8c<{@ҘI4OZ6 srK"=ut'Ўp4J黡6B!U8Vk\9z}:`Y`s2lڥSiT}{5WxޭA3aMz0Ɣ, …7Dxbɗi9d3r9FhIw6}xūYdva-nh)<Gj,`ũ gݮW?xsc`m;sm/س޽NÄ_|mZ@Lhq$`DjfυeHfyFZF%"98"J 8teV;vWuVIC#YGd]K$O%HHdVHB _Z@- "&b).b|jRneDhb%:Rz#d2٩BRYW%ֱzMʖTUZ\n)frګبvp<*眶yĶ@۝>4۟~XA$_Ҋu[j+/i&/V۪\+!1LÔBBy˭ĎwJ[}k1[/3{o/)sBtљ$L7PG-TWmu ;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/scale2.gif0000644000175000017500000000362710656147112016600 0ustar serge2serge2GIF87aÂ,I8ͻ`(dihlp,tmx|pH,urL ШtJJlzQ61(eW%| @ݝpuczh|l tvAxfAmnwdik@@??~>>r=z=Áq?|1\SKf-ڵ!<͙htN.0Λxʃ;N:򼰧Sf>v컩s>|~xzg3|~A^nFj4r6i`֗܂2D~m1$M6š}Ɨ~хX_0!/hH8#O'ff#iCc ?$;$ b9ѕXfEbҖ`i%>NBi9f}Ied"i% gO' zMnr5Zw2ꧣ*@z57ak%੧Pj `3Q Gg^I(*kqlmZuwۜ-z{ޫ*K!ɂ\ݖnZy餏{ӽ;0i頳^ Q'<<Oo$&X [. J cw<ϸ9? pa4Wl.(<-Qߨ4,tLl5/#Ү j֢ٙ) >K[A~hp:-xm7J쳫 ~x{k..zB{+~s3Zle.욮UC b.^>u݅66w{_lO%/~77c4{=.=@˛> =>?;ܷ_p?Ow4eq_8M#NlO8AO*fN|raHog9ahizzLhH(qCDJĸlRY7R j8T bT?&wH>6*Џx\`H4; #c?Bчr1Yd GH8td=YHI(IJ H$iD%#Fg&vJw-qL⻶Dk\BW1Ѵ淘bn vҙ eֹM*$iݨ 4OM+ Njl`?NPt0H\ƒL_0*рBԗ)^D3ѐu'MJK$n1v@,0/ra(*M 1(U"Ej|6uTU(SwաWMWʃuէĊ֮jTx]ɪJ[֩uV-zWB3A+*2O{T38_ ˹xBuj_7gH gmleȾggES{֠o[-lYWhs*AݲPJv-S+wm.tK,Vԭs&R`Zw]+^) z+|Kͯ~L7;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/transdove.gif0000644000175000017500000000066610656147112017434 0ustar serge2serge2GIF89aFK! !) Imported from GIF image: tempa29659.gif,FK3ڋQj3t ejRpˉ5w7'Y&z4OGل (8Z#G\wǘ뉽]Yl% ~S駇hADuxؠ')YBI8hI57X镒j jxt 9z ۫'kX v::, -=Mm[ ͥ-ylMDjJ*,aR_@oUlLQ&e0K$|eKh\ ,5 O|Y12djEW6Ѩcs`8aE,W%*Jt_(W%Χz<ݛ%R\zuP;Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/example.py0000644000175000017500000000400710656147112016736 0ustar serge2serge2import Tkinter import Pmw class ThresholdScale(Pmw.MegaWidget): """ Megawidget containing a scale and an indicator. """ def __init__(self, parent = None, **kw): # Define the megawidget options. optiondefs = ( ('colors', ('green', 'red'), None), ('threshold', 50, None), ('value', None, Pmw.INITOPT), ) self.defineoptions(kw, optiondefs) # Initialise base class (after defining options). Pmw.MegaWidget.__init__(self, parent) # Create the components. interior = self.interior() # Create the indicator component. self.indicator = self.createcomponent('indicator', (), None, Tkinter.Frame, interior, width = 16, height = 16, borderwidth = 2, relief = 'raised') self.indicator.grid() # Create the scale component. self.scale = self.createcomponent('scale', (), None, Tkinter.Scale, interior, command = self._doCommand, tickinterval = 20, length = 200, from_ = 100, to = 0, showvalue = 0) self.scale.grid() value = self['value'] if value is not None: self.scale.set(value) # Check keywords and initialise options. self.initialiseoptions() def _doCommand(self, valueStr): if self.scale.get() > self['threshold']: color = self['colors'][1] else: color = self['colors'][0] self.indicator.configure(background = color) Pmw.forwardmethods(ThresholdScale, Tkinter.Scale, 'scale') # Initialise Tkinter and Pmw. root = Pmw.initialise() root.title('Pmw ThresholdScale demonstration') # Create and pack two ThresholdScale megawidgets. mega1 = ThresholdScale() mega1.pack(side = 'left', padx = 10, pady = 10) mega2 = ThresholdScale( colors = ('green', 'yellow'), threshold = 75, value = 80, indicator_width = 32, scale_width = 25) mega2.pack(side = 'left', padx = 10, pady = 10) # Let's go. root.mainloop() Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/exercises.py0000644000175000017500000000666110656147112017305 0ustar serge2serge2import Tkinter import Pmw class ThresholdScale(Pmw.MegaWidget): """ Megawidget containing a scale and an indicator. """ def __init__(self, parent = None, **kw): # Define the megawidget options. optiondefs = ( ('colors', ('green', 'red'), None), ('orient', 'vertical', Pmw.INITOPT), ('labelmargin', 0, Pmw.INITOPT), ('labelpos', None, Pmw.INITOPT), ('threshold', (50,), None), ('value', None, Pmw.INITOPT), ) self.defineoptions(kw, optiondefs) # Initialise base class (after defining options). Pmw.MegaWidget.__init__(self, parent) # Create the components. interior = self.interior() # Create the indicator component. self.indicator = self.createcomponent('indicator', (), None, Tkinter.Frame, interior, width = 16, height = 16, borderwidth = 2, relief = 'raised') # Create the value component. self.value = self.createcomponent('value', (), None, Tkinter.Label, interior, width = 3) # Create the scale component. if self['orient'] == 'vertical': # The default scale range seems to be # the wrong way around - reverse it. from_ = 100 to = 0 else: from_ = 0 to = 100 self.scale = self.createcomponent('scale', (), None, Tkinter.Scale, interior, orient = self['orient'], command = self._doCommand, tickinterval = 20, length = 200, from_ = from_, to = to, showvalue = 0) value = self['value'] if value is not None: self.scale.set(value) # Use grid to position all components if self['orient'] == 'vertical': self.indicator.grid(row = 1, column = 1) self.value.grid(row = 2, column = 1) self.scale.grid(row = 3, column = 1) # Create the label. self.createlabel(interior, childRows=3) else: self.indicator.grid(row = 1, column = 1) self.value.grid(row = 1, column = 2) self.scale.grid(row = 1, column = 3) # Create the label. self.createlabel(interior, childCols=3) # Check keywords and initialise options. self.initialiseoptions() def _doCommand(self, valueStr): valueInt = self.scale.get() colors = self['colors'] thresholds = self['threshold'] color = colors[-1] for index in range(len(colors) - 1): if valueInt <= thresholds[index]: color = colors[index] break self.indicator.configure(background = color) self.value.configure(text = valueStr) Pmw.forwardmethods(ThresholdScale, Tkinter.Scale, 'scale') # Initialise Tkinter and Pmw. root = Pmw.initialise() root.title('Pmw ThresholdScale demonstration') # Create and pack two ThresholdScale megawidgets. mega1 = ThresholdScale(scale_showvalue = 1) mega1.pack(side = 'left', padx = 10, pady = 10) mega2 = ThresholdScale( colors = ('green', 'yellow', 'red'), threshold = (50, 75), value = 80, indicator_width = 32, scale_width = 25) mega2.pack(side = 'left', padx = 10, pady = 10) # Create and pack two horizontal ThresholdScale megawidgets. mega3 = ThresholdScale( orient = 'horizontal', labelpos = 'n', label_text = 'Horizontal') mega3.pack(side = 'top', padx = 10, pady = 10) mega4 = ThresholdScale(orient = 'horizontal') mega4.pack(side = 'top', padx = 10, pady = 10) # Let's go. root.mainloop() Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ExampleDemo.py0000644000175000017500000000141610656147112017504 0ustar serge2serge2title = 'Pmw.EXAMPLE demonstration' # Import Pmw from this directory tree. import sys sys.path[:0] = ['../../..'] import Tkinter import Pmw class Demo: def __init__(self, parent): # Create and pack the EXAMPLEs. self.widget1 = Pmw.Counter(parent) self.widget1.setentry('1') self.widget1.pack() self.widget2 = Pmw.Counter(parent, increment = 10) self.widget2.setentry('100') self.widget2.pack() ###################################################################### # Create demo in root window for testing. if __name__ == '__main__': root = Tkinter.Tk() Pmw.initialise(root) root.title(title) exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy) exitButton.pack(side = 'bottom') widget = Demo(root) root.mainloop() Pmw.1.3.2/src/Pmw/Pmw_1_3/doc/ScrolledText_test.py0000644000175000017500000000625710656147112020767 0ustar serge2serge2# Based on iwidgets2.2.0/tests/scrolledtext.test code. import Test import Pmw Test.initialise() c = Pmw.ScrolledText def _testYView(doBottom): w = Test.currentWidget() top, bottom = w.yview() if type(top) != type(0.0) or type(bottom) != type(0.0): return 'bad type ' + str(top) + ' ' + str(bottom) if doBottom: if bottom != 1.0: return 'bottom is ' + str(bottom) else: if top != 0.0: return 'top is ' + str(top) kw_1 = {'labelpos': 'n', 'label_text': 'ScrolledText'} tests_1 = ( (c.pack, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}), (Test.num_options, (), 10), (c.importfile, 'ScrolledText_test.py'), ('hull_background', 'aliceblue'), ('text_borderwidth', 3), ('Scrollbar_borderwidth', 3), ('hull_cursor', 'gumby'), ('text_exportselection', 0), ('text_exportselection', 1), ('text_foreground', 'Black'), ('text_height', 10), ('text_width', 20), ('text_insertbackground', 'Black'), ('text_insertborderwidth', 1), ('text_insertofftime', 200), ('text_insertontime', 500), ('text_insertwidth', 3), ('label_text', 'Label'), ('text_relief', 'raised'), ('text_relief', 'sunken'), ('Scrollbar_repeatdelay', 200), ('Scrollbar_repeatinterval', 105), ('vscrollmode', 'none'), ('vscrollmode', 'static'), ('vscrollmode', 'dynamic'), ('hscrollmode', 'none'), ('hscrollmode', 'static'), ('hscrollmode', 'dynamic'), ('Scrollbar_width', 20), ('text_selectborderwidth', 2), ('text_state', 'disabled'), ('text_state', 'normal'), ('text_background', 'GhostWhite'), ('text_wrap', 'char'), ('text_wrap', 'none'), ('vscrollmode', 'bogus', 'ValueError: bad vscrollmode ' + 'option "bogus": should be static, dynamic, or none'), ('hscrollmode', 'bogus', 'ValueError: bad hscrollmode ' + 'option "bogus": should be static, dynamic, or none'), (c.cget, 'vscrollmode', 'bogus'), (c.cget, 'hscrollmode', 'bogus'), ('vscrollmode', 'dynamic'), ('hscrollmode', 'dynamic'), (c.insert, ('end', 'Hello there\n')), (_testYView, 0), (c.yview, ('moveto', 0.02)), (c.yview, ('moveto', 0.04)), (c.yview, ('moveto', 0.06)), (c.yview, ('moveto', 0.08)), (c.yview, ('moveto', 0.10)), (c.yview, ('moveto', 0.12)), (c.yview, ('moveto', 0.14)), (c.yview, ('moveto', 0.16)), (c.yview, ('moveto', 0.18)), (c.yview, ('moveto', 0.20)), (c.yview, ('moveto', 0.22)), (c.yview, ('moveto', 0.24)), (c.yview, ('moveto', 0.26)), (c.yview, ('moveto', 0.28)), (c.yview, ('moveto', 0.98)), (_testYView, 1), (c.yview, ('scroll', -1, 'page')), (c.yview, ('scroll', -50, 'page')), (_testYView, 0), (c.yview, ('scroll', 1, 'page')), (c.yview, ('scroll', 50, 'page')), (_testYView, 1), (c.clear, ()), (c.get, (), '\n'), ) kw_2 = { 'hscrollmode' : 'dynamic', 'label_text' : 'Label', 'labelpos' : 'n', 'scrollmargin': 20, } tests_2 = ( (c.pack, (), {'padx' : 10, 'pady' : 10, 'fill' : 'both', 'expand' : 1}), (c.importfile, 'ScrolledText_test.py'), ('text_relief', 'raised'), ('text_relief', 'sunken'), ) alltests = ( (tests_1, kw_1), (tests_2, kw_2), ) testData = ((Pmw.ScrolledText, alltests),) if __name__ == '__main__': Test.runTests(testData) Pmw.1.3.2/src/Pmw/Pmw_1_3/bin/0000755000175000017500000000000010655462400014732 5ustar serge2serge2Pmw.1.3.2/src/Pmw/Pmw_1_3/bin/bundlepmw.py0000755000175000017500000001031510656147112017305 0ustar serge2serge2#!/usr/bin/env python # Helper script when freezing Pmw applications. It concatenates all # Pmw megawidget files into a single file, 'Pmw.py', in the current # directory. The script must be called with one argument, being the # path to the 'lib' directory of the required version of Pmw. # To freeze a Pmw application, you will also need to copy the # following files to the application directory before freezing: # # PmwBlt.py PmwColor.py import os import regsub import string import sys # The order of these files is significant. Files which reference # other files must appear later. Files may be deleted if they are not # used. files = [ 'Dialog', 'TimeFuncs', 'Balloon', 'ButtonBox', 'EntryField', 'Group', 'LabeledWidget', 'MainMenuBar', 'MenuBar', 'MessageBar', 'MessageDialog', 'NoteBook', 'OptionMenu', 'PanedWidget', 'PromptDialog', 'RadioSelect', 'ScrolledCanvas', 'ScrolledField', 'ScrolledFrame', 'ScrolledListBox', 'ScrolledText', 'HistoryText', 'SelectionDialog', 'TextDialog', 'TimeCounter', 'AboutDialog', 'ComboBox', 'ComboBoxDialog', 'Counter', 'CounterDialog', ] # Set this to 0 if you do not use any of the Pmw.Color functions: needColor = 1 # Set this to 0 if you do not use any of the Pmw.Blt functions: needBlt = 1 def expandLinks(path): if not os.path.isabs(path): path = os.path.join(os.getcwd(), path) while 1: if not os.path.islink(path): break dir = os.path.dirname(path) path = os.path.join(dir, os.readlink(path)) return path def mungeFile(file): # Read the file and modify it so that it can be bundled with the # other Pmw files. file = 'Pmw' + file + '.py' text = open(os.path.join(srcdir, file)).read() text = regsub.gsub('import Pmw\>', '', text) text = regsub.gsub('INITOPT = Pmw.INITOPT', '', text) text = regsub.gsub('\