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. Now enter a number and click on the arrow buttons to see the number increment or decrement. Once a megawidget has been created, you can call any of its other methods in a similar way to Tk widgets.
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. For example, the following code prints the values of some of the counter options.